美文网首页技术
[nginx] 反向代理访问出错 502 (13: Permi

[nginx] 反向代理访问出错 502 (13: Permi

作者: w_w_wei | 来源:发表于2019-07-30 10:14 被阅读0次

    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
    

    配置完成后再次访问正常

    相关文章

      网友评论

        本文标题:[nginx] 反向代理访问出错 502 (13: Permi

        本文链接:https://www.haomeiwen.com/subject/allgrctx.html