我的 nginx 返回 404?我不确定为什么
这是我的 /sites-available/default 文件,nginx.conf 是默认的,我没有改变任何东西。
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/example.com/htdocs/public;
index index.php index.html index.htm index.nginx-debian.html;
server_name example.com www.example.com;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}