wordpress配置固定链接nginx访问404问题解决方法
2016-03-28 02:13
1026 查看
WordPress支持使用固定链接,但是在ngnix环境下,访问页面后出现404,
其实官方是有文档说明的,需要单独写配置,
我这边配置的示例代码如下:
其实官方是有文档说明的,需要单独写配置,
我这边配置的示例代码如下:
server { listen 80; server_name www.chaichunyan.com; access_log /var/log/nginx/access.log main; location / { root /www/data/xxx; index index.php index.html index.htm; if (-f $request_filename/index.html){ rewrite (.*) $1/index.html break; } if (-f $request_filename/index.php){ rewrite (.*) $1/index.php; } if (!-f $request_filename){ rewrite (.*) /index.php; } } rewrite /wp-admin$ $scheme://$host$uri/ permanent; location ~ \.php$ { root /www/data/xxx; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }
相关文章推荐
- Nginx学习笔记:对正向服务器与反向服务器的理解
- NGINX学习笔记——Choosing an Outgoing IP Address
- 在 CentOS7 下用 yum 安装 nginx
- NGINX学习笔记——配置缓冲
- NGINX学习笔记——传递请求头
- mac os 下 nginx 修改配置文件nginx.conf并重启
- nginx信号控制
- Java笔记---通过nginx和FileZilla部署代码到云服务器
- Nginx增加模块
- 01-Nginx初探
- 使用Nginx+FFmpeg搭建HLS直播转码服务器
- Nginx学习笔记
- Nginx学习笔记——配置简单代理服务器
- Nginx Location配置总结
- Nginx
- 一次nginx 502 & mysql not contect 排错经历
- nginx日志切割
- Nginx+PHP+mysql
- window下搭建Nginx
- 配置nginx使之支持pathinfo