网上好多都不论用,搞了一天,最初尝试了一下,只须要改一个就好了.
将include enable-php.conf 改为 include enable-php-pathinfo.conf即可
而后 lnmp restart
这是一键装置后的 nginx.conf 文件的配置原文
server
{ listen 443 ssl;
listen 80 default_server;
#listen [::]:80 default_server ipv6only=on;
server_name _;#写本人的域名
index index.html index.htm index.php;
root /home/wwwroot/default;
#error_page 404 /404.html;
# Deny access to PHP files in specific directory #location ~ /(wp-content|uploads|wp-includes|images)/.*.php$ { deny all; }
include enable-php.conf;#这是替换的中央:将include enable-php.conf 改为 include enable-php-pathinfo.conf
location /nginx_status
{
stub_status on;
access_log off;
}
location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*.(js|css)?$
{
expires 12h;
}
location ~ /.well-known {
allow all;
}
location ~ /.
{
deny all;
}
access_log /home/wwwlogs/access.log;
}
而后就好了!
发表回复