我正在使用Nginx和Gunicorn配置Django项目.
当我在Nginx服务器上访问我的端口gunicorn mysite.wsgi:application --bind=127.0.0.1:8001
时,我的错误日志(log)文件中出现以下错误;
2014/05/30 11:59:42[CRET]4075#0:*6 CONNECT()to 127.0.0.1:8001连接到upstream 时失败(13:权限被拒绝),客户端:127.0.0.1,服务器:localhost,请求:"Get/HTTP/1.1",upstream :
"http://127.0.0.1:8001/"
,主机:"localhost: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
.
我犯了什么错?