1. 程式人生 > >nginx配置proxy_pass出現502/13: Permission denied問題解決

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