【发布时间】:2014-07-19 20:31:36
【问题描述】:
我正在使用 Nginx 和 Gunicorn 配置 Django 项目。
当我在 Nginx 服务器中访问我的端口 gunicorn mysite.wsgi:application --bind=127.0.0.1:8001 时,我的错误日志文件中出现以下错误;
2014/05/30 11:59:42 [crit] 4075#0: *6 connect() 到 127.0.0.1:8001 连接到上游时失败(13:权限被拒绝),客户端:127.0.0.1,服务器:本地主机,请求:“GET / HTTP/1.1”,上游:
"http://127.0.0.1:8001/",主机:“本地主机:8080”
下面是我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;
}
}
在 HTML 页面中,我收到了502 Bad Gateway。
我做错了什么?
【问题讨论】:
标签: django python-2.7 nginx gunicorn