(13:权限被拒绝)连接到上游时:[nginx] - (13: Permission denied) while connecting to upstream:[nginx]

语言: CN / TW / HK

问题:

I am working with configuring Django project with Nginx and Gunicorn.我正在使用 Nginx 和 Gunicorn 配置 Django 项目。

While I am accessing my port gunicorn mysite.wsgi:application --bind=127.0.0.1:8001 in Nginx server, I am getting the following error in my error log file;当我在 Nginx 服务器中访问我的端口gunicorn mysite.wsgi:application --bind=127.0.0.1:8001时,我在错误日志文件中收到以下错误;

2014/05/30 11:59:42 [crit] 4075#0: *6 connect() to 127.0.0.1:8001 failed (13: Permission denied) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8001/" , host: "localhost:8080" 2014/05/30 11:59:42 [crit] 4075#0: *6 connect() to 127.0.0.1:8001 连接到上游时失败(13:权限被拒绝),客户端:127.0.0.1,服务器:本地主机,请求:“GET / HTTP/1.1”,上游: "http://127.0.0.1:8001/" ,主机:“localhost:8080”

Below is the content of my nginx.conf file;下面是我的nginx.conf文件的内容;

server {
    listen 8080;
    server_name localhost;
    access_log  /var/log/nginx/example.log;
    error_log /var/log/nginx/example.error.log;

    location / {
        proxy_pass http://127.0.0.1:8001;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host $http_host;
    }
}

In the HTML page I am getting 502 Bad Gateway .在 HTML 页面中,我收到502 Bad Gateway

What mistake am I doing?我在做什么错误?


解决方案:

参考一: http://stackoom.com/question/1cU6Z
参考二: (13: Permission denied) while connecting to upstream:[nginx]
「其他文章」