繁体   English   中英

502错误的网关:[nginx / 1.4.7]

[英]502 Bad Gateway:[nginx/1.4.7]

我正在使用gunicorn和nginx服务器配置django(1.6.5)项目。该项目成功使用django基本服务器python manage.py runserver 。后来我将地址与gunicorn绑定为gunicorn myproject.wsgi:application --bind=127.0.0.1:8001 。并在/etc/nginx/nginx.conf中的nginx.conf文件中进行/etc/nginx/nginx.conf 。当我重新启动nginx服务器并在浏览器中将请求指定为localhost:8080时,我得到了502 Bad Gateway我在做什么错误

这是我的nginx.conf代码

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

location / {
    proxy_pass http://127.0.0.1:8001;
    }
  } 

更新:

在错误日志文件中: error_log /var/log/nginx/example.error.log;

我得到以下内容;

2014/05/29 13:13:08 [crit] 6701#0: *1 connect() to 0.0.0.0:8001 failed (13: Permission denied) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "http://0.0.0.0:8001/", host: "localhost:8080"

任何帮助,将不胜感激。

我已经把我的工作用户名作为最新的Fedora克服上述问题nginx工作user.I必须找到我的顶端的用户nginx.conf文件中/etc/nginx directory.I我目前正在为user在Linux环境,并取代了用户名nginxusernginx.conf文件。 我的问题就解决了。

显然期望在8001上使用HTTP(不是WSGI)处理程序。您可以在此处阅读有关Nginx WSGI配置的更多信息: http : //uwsgi-docs.readthedocs.org/en/latest/Nginx.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM