温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

nginx的[error] 6702#0报错怎么解决

发布时间:2021-12-13 10:00:24 来源:亿速云 阅读:152 作者:iii 栏目:服务器

本篇内容主要讲解“nginx的[error] 6702#0报错怎么解决”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“nginx的[error] 6702#0报错怎么解决”吧!

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

到此,相信大家对“nginx的[error] 6702#0报错怎么解决”有了更深的了解,不妨来实际操作一番吧!这里是亿速云网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI