laravel nginx https 404

Laravel环境 nginx配置了Https访问,除了首页面可以正常访问,其他路由都是404,查了很多资料没找到原因;如果换成http访问,所有访问都是正常的;请帮忙看看;这是我的配置

listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
ssl_certificate localhost.pem;
ssl_certificate_key localhost.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
server_name localhost;
root /data/wwwwroot/project/public;
index index.php index.html index.htm;
         
location ~ [^/]\.php(/|$) {
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
}        
         
location / {
        try_files $uri $uri/ /index.php?$query_string;   
}        
阅读 2.3k
1 个回答
试试

 try_files $uri $uri/ @rewrite;

    location @rewrite {
            rewrite ^/(.*)$ /index.php?_url=/$1;
    }
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题