配置wordpress时出现403 Forbidden nginx/1.10.2
来源:互联网 发布:上帝已死 知乎 编辑:程序博客网 时间:2024/06/03 08:16
配置过很多次wordpress,都是按教程的顺序来的。这一次托大,按自己的理解来配置,So,很悲摧的出现了
403 Forbidden nginx/1.10.2
同样是403 Forbidden nginx/1.10.2,如果与 wordpress不相关,那基本都是因为/var/www/html目录的权限问题,避免此类问题最简单有效的手段是全部chmod 777。
但对于我的问题,并没有用。
我的问题在于,想犯懒只修改default.conf文件,却又没有改全。只做了两件事:
- 取消ipv6的监听
- 设置root目录
然而,这显然是不够的。此处修改后文件如下:
server { listen 80 default_server; #listen [::]:80 default_server; server_name _; root /var/www/html/; # Load configuration files for the default server block. include /etc/nginx/default.d/*.conf; location / { } error_page 404 /404.html; location = /40x.html { } error_page 500 502 503 504 /50x.html; location = /50x.html { }}
解决思路是仔细的分析原文档,发现在wordpress.conf文件中,比我的default.conf多做了一点事情。
除了前文提到的取消ipv6监听和设置root目录,还起了php的监听服务。
到这里,有两种解决方案:
方案一:
将php监听相关的配置写入default.conf中,继续使用默认的配置文件
方案二:
不用默认的文件,新写一个配置文件。这也是官方文档所使用的方法。
为了防止出错,还是决定像官文文档学习,新加一个配置文件。
新配置文件内容如下:
server { listen 80; root /var/www/html/; location / { index index.php index.html index.htm; try_files $uri $uri/ /index.php index.php; } location ~ .php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }}
So,问题解决。
阅读全文
0 0
- 配置wordpress时出现403 Forbidden nginx/1.10.2
- Wordpress出现403 Forbidden错误
- 配置nginx 403 Forbidden
- nginx出现403 Forbidden解决方法
- nginx 出现403 Forbidden 解决方法
- nginx出现403 forbidden的错误
- nginx favicon.ico 出现403 forbidden
- Nginx 出现 403 Forbidden 的解决办法
- Nginx 出现 403 Forbidden 的解决办法
- apache WordPress 伪静态.htaccess出现403 Forbidden Error
- [WordPress] 403 forbidden error
- Mac下配置apache 时出现问题,403Forbidden
- Mac下配置apache 时出现问题,403Forbidden
- Mac下配置apache 时出现问题,403Forbidden
- apache2.2的大量虚拟主机配置出现403 Forbidden
- nginx出现403 forbidden错误的两种原因
- nginx出现403 forbidden错误的两种原因
- Nginx 出现403 forbidden错误的设置方法!
- 最近的计划
- 阿里云服务器配置(二)
- 深度优先搜索DFS
- java可重入锁(ReentrantLock)的实现原理
- Spring MVC--16.参数接受map
- 配置wordpress时出现403 Forbidden nginx/1.10.2
- python3 利用pip安装ipython notebook
- java面试题02
- 微信公众号----微信支付踩坑
- Redis实战(一) 使用缓存合理性
- 04 Activity窗口间的切换及参数的传递
- Java中日期和字符串的互相转化
- linux -my ls
- PAT 甲级 1034. Head of a Gang (30)