Centos 7
配置完成后访问页面 502
查看日志
2019/07/30 11:03:08 [crit] 30838#30838: *303 connect() to 127.0.0.1:9501 failed (13: Permission denied) while connecting to upstream, client: 113.246.xxx.xxx, server: localhost.com, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:9501/", host: "localhost.com"
检查网络访问的配置
[root@localhost nginx]# getsebool -a | grep httpd_can_network_connect
httpd_can_network_connect --> off
httpd_can_network_connect_cobbler --> off
httpd_can_network_connect_db --> off
#写入配置文件的命令,重启后失效
#setsebool httpd_can_network_connect=1
#写入配置文件的命令,重启后保留
#setsebool -P httpd_can_network_connect 1
[root@localhost nginx]# setsebool -P httpd_can_network_connect 1
[root@localhost nginx]# getsebool -a | grep httpd_can_network_connect
httpd_can_network_connect --> on
httpd_can_network_connect_cobbler --> off
httpd_can_network_connect_db --> off
配置完成后再次访问正常
网友评论