nginx配置proxy_pass出现502/13: Permission denied问题解决

场景

centos 7 :nginx配置监听80端口,并将请求转发到Tomcat 8080端口。浏览器访问域名,出现502错误。
通过查看nginx日志:

connect() to 127.0.0.1:9090 failed (13: Permission denied) while connecting to upstream, client

解决方案

查看系统httpd配置:

getsebool -a | grep httpd

设置httpd可以连接到网络,执行命令:

setsebool httpd_can_network_connect on -P

参考

https://stackoverflow.com/questions/23948527/13-permission-denied-while-connecting-to-upstreamnginx

你可能感兴趣的:(Linux)