解决Nginx的connect() to xxx.xx.xxx.xxx:2345 failed (13: Permission denied) while connecting to upstream
来源:互联网 发布:有卖淘宝店铺的吗 编辑:程序博客网 时间:2024/06/11 21:14
在使用Nginx进行反向代理链接后端机器的时候遇到了这个权限问题,在error.log日志中,我们可以看到如下:
*1 connect() to 123.57.32.110:2345 failed (13: Permission denied) while connecting to upstream, client: 113.66.157.96,
经过查资料,应该是SeLinux的导致的。可以选择一些两种方式进行:
一、关闭SeLinux
查看SELinux状态:
1、/usr/sbin/sestatus -v ##如果SELinux status参数为enabled即为开启状态
SELinux status: enabled
2、getenforce ##也可以用这个命令检查
关闭SELinux:
1、临时关闭(不用重启机器):
setenforce 0 ##设置SELinux 成为permissive模式
##setenforce 1 设置SELinux 成为enforcing模式
2、修改配置文件需要重启机器:
修改/etc/selinux/config 文件
将SELINUX=enforcing改为SELINUX=disabled
重启机器即可
二、执行下面的命令
setsebool -P httpd_can_network_connect 1
参考资料:
http://www.hpboys.com/827.html
http://www.hpboys.com/824.html
0 0
- 解决Nginx的connect() to xxx.xx.xxx.xxx:2345 failed (13: Permission denied) while connecting to upstream
- 完美解决Nginx配置反向代理时出现的13: Permission denied) while connecting to upstream, client: 127.0.0.1
- centos7 nginx permission denied while connecting to upstream
- 解决Nginx的connect() to 127.0.0.1:8080 failed (13: Permission denied) while connect
- 解决Nginx的connect() to 127.0.0.1:8080 failed (13: Permission denied) while connect
- nginx反向代理tomcat提示13 permission denied while connecting to upstream
- 解决mac电脑上出现Permission to xxx.git denied to xxx的问题
- git使用中遇到的remote:Permission to xxx denied to xxx问题如何解决
- connect() failed (111: Connection refused) while connecting to upstream的解决
- file_get_contents failed to open stream: Permission denied in xxx解决办法
- MACOS下解决git push error: Permission to XXX.git denied to XXX
- connect() failed (111: Connection refused) while connecting to upstream
- nginx 报错 connect() failed (111: Connection refused) while connecting to upstream
- ssh :connect to host XXX.XXX.XXX.XXX port XX: Connection refused
- 遇到问题----connect() failed (111: Connection refused) while connecting to upstream解决
- 遇到问题----connect() failed (111: Connection refused) while connecting to upstream解决
- Host ''xxx.xx.xxx.xxx'' is not allowed to connect to this MySQL server
- host'xx.xxx.xxx.xxx' is not allowed to connect to this mysql server
- 微信浏览器禁止app下载链接怎么办
- pku1141 Brackets Sequence 区间DP
- h5
- Java并发编程:线程池的使用
- 怎么在互联网公司带团队
- 解决Nginx的connect() to xxx.xx.xxx.xxx:2345 failed (13: Permission denied) while connecting to upstream
- 微信视频开发jquery mobile
- KNN 算法的python实现 迭代训练方式,将最近的测试样例作为训练样例扩大训练集
- COM控件快速入门
- [OpenType 1.70 笔记] SVG 表
- LeetCode102—Binary Tree Level Order Traversal
- Android学习路线指南
- Objective-C之run loop详解
- Android之焦点小应用