问题:搭建好项目之后,用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 

解决nginx访问问题connect() to 127.0.0.1:8080 failed (13: Permission denied) while connecting to upstream,的更多相关文章

  1. 解决nginx下connect() to 127.0.0.1:3000 failed (13: Permission denied) while connecting to upstream, client: 127.0.0.1, server: 错误信息

    尝试搭建nginx负载均衡,做域名转发时报如上错误,困扰了好长时间还好没放弃,还好百度找到解决办法: 是SeLinux导致: 1.执行下面的命令 setsebool -P httpd_can_netw ...

  2. Nginx: 解决connect() to xxxx failed (13: Permission denied) while connecting to upstream的问题

    一句话:setsebool httpd_can_network_connect true

  3. 解决Nginx的connect() to 127.0.0.1:8080 failed (13: Permission denied) while connect

    在进行Nginx+Tomcat 负载均衡的时候遇到了这个权限问题,在error.log日志中.我们能够看到例如以下: connect() to 127.0.0.1:8080 failed (13: P ...

  4. php fpm安装curl后,nginx出现connect() to unix:/var/run/php5-fpm.sock failed (13: Permission denied)的错误

    这里选择直接apt-get安装,因为比起自己编译简单多了,不需要自己配置什么 #sudo apt-get install curl libcurl3 libcurl3-dev php5-curl 安装 ...

  5. Centos 7 上使用nginx为Node.js配置反向代理时错误:(13: Permission denied) while connecting to upstream

    错误来源:Centos 7 上使用nginx为Node.js配置反向代理时产生(13: Permission denied) while connecting to upstream的错误 nginx ...

  6. 解决Nginx的13: Permission denied) while connecting to upstream

    一.问题 做Nginx负载的时候,经常遇到这样的情况: // :: [crit] #: * connect() to failed (: Permission denied) while connec ...

  7. nginx 502错 failed (13: Permission denied)

    安装nginx和php-fpm之后出现502错误 找了个理由说php-fpm不启动 ,但在我的实践中,该过程开始 找了半天没找到病因.视图nginx记录后 我发现下面的错误 [crit] 2686#0 ...

  8. 解决nginx报错:nginx: [emerg] bind() to 0.0.0.0:8088 failed (13: Permission denied)

    报错描述: nginx: [emerg] bind() to 0.0.0.0:8088 failed (13: Permission denied) 通过ansible远程给主机更换端口并重新启动ng ...

  9. 解决Mac nginx问题 [emerg] 54933#0: bind() to 0.0.0.0:80 failed (13: Permission denied)

    brew services restart nginx Stopping nginx... (might take a while) ==> Successfully stopped nginx ...

随机推荐

  1. hdu 5037 周期优化

    http://acm.hdu.edu.cn/showproblem.php?pid=5037 有只青蛙踩石子过河,河宽m,有n个石子坐标已知.青蛙每次最多跳L.现在可以在河中再放一些石子,使得青蛙过河 ...

  2. calltree+graphviz 绘出项目函数调用图

    install calltree: download from http://linux.softpedia.com/progDownload/calltree-Download-971.html f ...

  3. 在TFS持续集成(持续发布)中执行Telnet任务

    Telnet是一种在因特网或局域网上使用虚拟终端连接,提供双向交互式文本通信设备的协议. 它是最早的互联网通讯协议之一.自1969年启用以来,已经经过了将近50年时间,在开放式的操作系统中拥有广泛的用 ...

  4. 关于文件的INode与Java中的文件操作接口

    本文由作者周梁伟授权网易云社区发布. 近日做的项目中涉及到多进程共同读写多个文件的问题,文件名和最后修改时间都是可能会被频繁修改的,因而识别文件的唯一性会产生相当的麻烦,于是专门再学习了一下文件系统对 ...

  5. APP间传递消息

    https://www.jianshu.com/p/d640ccfcea5f 1: URL Scheme 常用的App间传值方式.常见于分享等. 2: Keychain  借助系统类 Keychain ...

  6. jzoj5931

    根據打表可得,對於n的情況 任意一個首位!=1的排列時,則其答案-1可以與首位為1的情況對應 當n=4時 排列 答案 1 2 3 4 ------ 0 1 2 4 3 ------ 1 1 3 2 4 ...

  7. Mysql的Text和Blob的比较

    MySQL存在text和blob: (1)相同 在TEXT或BLOB列的存储或检索过程中,不存在大小写转换,当未运行在严格模式时,如果你为BLOB或TEXT列分配一个超过该列类型的最大长度的值,值被截 ...

  8. Java程序员的日常—— Spring Boot单元测试

    关于Spring boot 之前没有用Spring的时候是用的MockMvc,做接口层的测试,原理上就是加载applicationContext.xml文件,然后模拟启动各种mybatis\连接池等等 ...

  9. centOS7 下安装smb服务器

    转载自:http://www.cnblogs.com/lgh344902118/p/7503620.html centOS7和windows10 samba是一款可以让linux和windows下共享 ...

  10. [ActionScript 3.0] UDP通信

    package com.controls.socket { import flash.events.DatagramSocketDataEvent; import flash.events.Event ...