Laravel environment nginx is configured with Https access. Except the first page can be accessed normally, all routes are 404. After checking a lot of information, we can"t find the reason. If you switch to http access, all visits are normal. Please take a look at it; this is my configuration
.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;
}