/***************************************************************************
* socket() failed (13: Permission denied) while connecting to upstream
* 说明:
* 这个错误隐藏的挺深的,观察了许久,才从ps aux中的执行用户中找出来。
*
* 2016-9-26 深圳 南山平山村 曾剑锋
**************************************************************************/ 一、错误现象:
// :: [alert] #: * socket() failed (: Permission denied) while connecting to upstream, client: 192.168.1.144, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "192.168.1.203" 二、原因:
. # ps aux
......
root /sbin/klogd -n
root udhcpc -R -n -p /var/run/udhcpc.eth0.pid -i eth0
root nginx: master process /usr/sbin/nginx
www-data nginx: worker process
root /usr/sbin/sshd
root /usr/sbin/telnetd -F
root php-cgi -b 127.0.0.1: -c /etc/php.ini
root {mysqld_safe} /bin/sh /usr/bin/mysqld_safe --pid-file=/run/mysql
root /usr/libexec/mysqld --basedir=/usr --datadir=/var/mysql --user=r
root -sh
root ps
. 如上所示,1468进程执行用户是www-data无法访问到1485进程的php-cgi,因为这个root权限。 三、解决办法:
cat /etc/nginx/nginx.conf
user root;
......

socket() failed (13: Permission denied) while connecting to upstream的更多相关文章

  1. 解决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 fa ...

  2. 解决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 ...

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

    一句话:setsebool httpd_can_network_connect true

  4. 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 ...

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

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

  6. 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 安装 ...

  7. 解决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 ...

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

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

  9. Ubuntu nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)

    在Ubuntu 12中启动刚安装好的Nginx,报错: nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied) 原因如下: ...

随机推荐

  1. 10个必备的移动UI设计资源站(转)

    创建移动设计模式是非常重要的一步,记住!这是为移动设备设计而不是web.不仅仅是移动屏幕远小于普通的电脑屏幕,关键是鼠标和键盘已经被手指替代了! 当然还有更重要的,说起来很苦逼,我们再也不能使用一种模 ...

  2. Ubuntu 设置su密码

    如果之前安装时没有设置root密码,可以如下设置: 命令窗口中输入:sudo passwd [sudo] password for 用户名:  这里输入你sudo 的密码输入新的 UNIX 密码: 重 ...

  3. 如何实现301的跳转?当输入域名http://xxx.com的时候自动重定向到www上去

    答案:在服务器上操作,注意勾选和不勾选的区别,使用Fiddle进行观察,301和302之间的区别

  4. 深入理解Redis:底层数据结构

    简介 redis[1]是一个key-value存储系统.和Memcached类似,它支持存储的value类型相对更多,包括string(字符串).list(链表).set(集合).zset(sorte ...

  5. sql删除多余重复的数据只保留一条

    delete from people where   peopleName in (select peopleName    from people group by peopleName      ...

  6. checkbox全选功能

    $("#cb_classType_all").change(function () { if ($(this).is(":checked")) { $(&quo ...

  7. https://github.com/oneuijs/You-Dont-Need-jQuery

    https://github.com/oneuijs/You-Dont-Need-jQuery

  8. 后台框架--HUI 的学习跟使用1

    下载跟查看说明文档:官方 https://github.com/jackying/ 官网:http://www.h-ui.net/H-ui.admin.shtml 后台,http://www.h-ui ...

  9. DotNetBar v12.6.0.4 Fully Cracked

    更新信息: http://www.devcomponents.com/customeronly/releasenotes.asp?p=dnbwf&v=12.6.0.4 如果遇到破解问题可以与我 ...

  10. JS中javascript:void(0)真正含义

    对于下面的代码,其中void(0)的含义是什么? <a href="javascript:Test();void(0);">hello</a> 其实,Jav ...