2016-08-01 168 views
1

我改变了我的固定链接结构以使用邮政编码 我重新启动了Nginx来清除缓存,但即使我可以显示我的主页,当我打开任何链接时, 404页面没有找到,wordpress - 更新固定链接后找不到404页面nginx

使用Nginx的,我没有更新.htaccess文件,但我应该更新我的网站的Nginx的conf文件...

这里是与使用的位置部分.php

 location ~ \.php$ { 
      try_files $uri =404; 
      fastcgi_pass 127.0.0.1:9000; 
      # 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; } 

感谢feedbac ķ

回答

3

这不是一个完整的文件部分!服务器{}缺失。

使用这一个,但使用服务器之间的一个{}并应工作

location ~ \.php$ { 
     try_files $uri =404; 
     fastcgi_pass 127.0.0.1:9000; 
     # 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; 
} 
if (!-e $request_filename) { 
    rewrite ^.*$ /index.php last; 
} 
1

更新/位置

location/{ 
     # include the "?$args" part so non-default permalinks doesn't break when using query string 
     try_files $uri $uri/ /index.php?$args; 
    } 

工作现在罚款...

相关问题