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

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

问题描述: 配置完 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. 再次访问,成功!

 

转载于:https://www.cnblogs.com/andy6/p/7010824.html

你可能感兴趣的文章
Revit2014机电系统类型BUG
查看>>
android Handler的使用(一)
查看>>
函数指针
查看>>
数学图形之Boy surface
查看>>
linux远程连接
查看>>
最快速的Android开发环境搭建ADT-Bundle及Hello World
查看>>
一分钟制作U盘版BT3 - 有图滴儿 bt3破解教程
查看>>
Objective-C中把数组中字典中的数据转换成URL
查看>>
hdu2196
查看>>
mysqld: unrecognized service
查看>>
Windows环境下利用github快速配置git环境
查看>>
HTML静态页面传值,HTML静态页面得到url问号后面的参数。
查看>>
WPF学习笔记-用Expression Design制作矢量图然后导出为XAML
查看>>
[裴礼文数学分析中的典型问题与方法习题参考解答]5.1.22
查看>>
锐捷上网认证常见问题及解决办法
查看>>
Eclipse+超快速的模拟器Genymotion开展Android申请书(第一步:安装和配置Genymotion)...
查看>>
MySQL查看一个表的创建文本以及删除表某列的索引
查看>>
BZOJ3009 : 集合
查看>>
android图片压缩的3种方法实例
查看>>
SVN(TortoiseSVN)提交时忽略bin跟obj目录
查看>>