博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
nginx之 [error] 6702#0:XXX is forbidden (13: Permission denied)
阅读量:2492 次
发布时间:2019-05-11

本文共 1331 字,大约阅读时间需要 4 分钟。

问题描述: 配置完 nginx 两个虚拟机后,客户端能够访问原始的server ,新增加的 server 虚拟机 不能够访问,报错如下页面

解决过程:

1. 查看报错日志

[root@mysql03 nginx]# cat logs/error.log 
2017/06/15 04:00:57 [error] 6702#0: *14 "/root/html/index.html" is forbidden (13: Permission denied), client: 10.219.24.1, server: www.nginx02.com, request: "GET / HTTP/1.1", host: "www.nginx02.com"
[root@mysql03 logs]# date
Thu Jun 15 04:01:27 CST 2017
2. 检查权限
[root@mysql03 ~]# ll
drwxr-xr-x. 2 root root 4096 Jun 15 03:59 html
[root@mysql03 html]# ll
total 8
-rw-r--r--. 1 root root 537 Jun 15 03:59 50x.html
-rw-r--r--. 1 root root 616 Jun 15 03:51 index.html
说明:发现目录权限没有问题
3. 检查nginx启动进程
[root@mysql03 logs]# ps anx|grep nginx
6546 ? Ss 0:00 nginx: master process ./sbin/nginx
6702 ? S 0:00 nginx: worker process
6726 pts/1 S+ 0:00 grep nginx
说明:发现nginx的work process是nobody的
4. 修改 nginx.conf 文件
打开nginx.conf文件所在的目录,查看文件的属性 (root root)
[root@mysql03 nginx]# ll
drwxr-xr-x. 2 root root 4096 Jun 15 04:08 conf
在nginx.conf文件的第一行加上 user root root;
[root@mysql03 nginx]# cat conf/nginx.conf
user root root;
5. 重新 reload nginx进程
[root@mysql03 nginx]# ./sbin/nginx -s reload
6. 再次访问,成功!

 补充:如果配置不能正常访问, 试参考 http://blog.csdn/zhang123456456/article/details/73252148

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31383567/viewspace-2140751/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/31383567/viewspace-2140751/

你可能感兴趣的文章
第一轮面试题
查看>>
2020-11-18
查看>>
Docker面试题(二)
查看>>
一、redis面试题及答案
查看>>
消息队列2
查看>>
C++ 线程同步之临界区CRITICAL_SECTION
查看>>
测试—自定义消息处理
查看>>
MFC中关于虚函数的一些问题
查看>>
根据图层名获取图层和图层序号
查看>>
规范性附录 属性值代码
查看>>
提取面狭长角
查看>>
Arcsde表空间自动增长
查看>>
Arcsde报ora-29861: 域索引标记为loading/failed/unusable错误
查看>>
记一次断电恢复ORA-01033错误
查看>>
C#修改JPG图片EXIF信息中的GPS信息
查看>>
从零开始的Docker ELK+Filebeat 6.4.0日志管理
查看>>
How it works(1) winston3源码阅读(A)
查看>>
How it works(2) autocannon源码阅读(A)
查看>>
How it works(3) Tilestrata源码阅读(A)
查看>>
How it works(12) Tileserver-GL源码阅读(A) 服务的初始化
查看>>