zoukankan      html  css  js  c++  java
  • 解决nginx访问问题connect() to 127.0.0.1:8080 failed (13: Permission denied) while connecting to upstream,

    问题:搭建好项目之后,用nginx进行代理,进行日常配置之后,发现前端正常访问,但是后端访问出现错误,报502错误,查找nginx日志,发现connect() to 127.0.0.1:8080 failed (13: Permission denied) while connecting to upstream,有这个错误。网上查阅得知是selinux没有关闭。

    解决步骤:

      关闭selinux

    [root@localhost ~]# getenforce 
    Enforcing
    [root@localhost ~]# setenforce 0
    [root@localhost ~]# getenforce 
    Permissive
    [root@localhost ~]# sed -i 's/(^SELINUX=).*/SELINUX=disabled/' /etc/selinux/config
    

    网上还有一种说法,在此记录下。执行下面的命令

    setsebool -P httpd_can_network_connect 1

     

     

  • 相关阅读:
    Python保留最后N个元素
    STL算法
    STL迭代器
    STL容器
    C++总结1
    牛客剑指Offer2
    Vue第一天
    UML
    Java继承和组合代码
    Java15后的sealed阻止继承滥用
  • 原文地址:https://www.cnblogs.com/operationhome/p/9107072.html
Copyright © 2011-2022 走看看