[英]Nginx returns 404 Not Found except index page
server {
listen 80;
server_name avadore.my.id;
root /var/www/avadore.my.id/public;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
index index.html index.htm index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
error_page 404 /index.php;
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
}
Basically this is the conf file and I tried many solutions from the internet and didnt find a solution but basically i changed the try_files $uri $uri/ /index.php?$query_string;基本上这是 conf 文件,我从互联网上尝试了许多解决方案,但没有找到解决方案,但基本上我更改了 try_files $uri $uri/ /index.php?$query_string; to try_files $uri $uri/ /index.php?$is_args$args; to try_files $uri $uri/ /index.php?$is_args$args; and to 404 but still didnt work.和 404 但仍然没有工作。 Appreciate any help感谢任何帮助
I found the problem is that my laravel version was 9 but i think it is only compatible with php version 8 but mines was version 7 so upgarding the php solves the problem thank you我发现问题是我的 laravel 版本是 9 但我认为它只与 php 版本 8 兼容,但我的是版本 7 所以升级 ZE1BFD762321E409CEE4AC0B6E841963C 解决了问题谢谢
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.