由于某种原因,“简单”链接以外的永久链接不起作用。如果设置不同的类型,则在 Nginx 上进入服务器页面时会出现 404 错误。
listen 80;
listen [::]:80;
server_name 127.0.0.1;
root /var/www/html;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}
location ~ /\.ht {
deny all;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires 30d;
log_not_found off;
add_header Cache-Control "public";
}
}
会不会是配置问题?