我正在使用nginx和gunicorn配置django项目.当我gunicorn mysite.wsgi:application --bind=127.0.0.1:8001在nginx服务器中访问我的端口时,我在错误日志文件中收到以下错误.
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;
}
}
Run Code Online (Sandbox Code Playgroud)
我的"http://127.0.0.1:8001/"档案
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;
}
}
Run Code Online (Sandbox Code Playgroud)
在我得到的html页面中nginx.conf.
我做错了什么?
我在我的nginx-error.log文件中收到此错误:
2014/02/17 03:42:20 [crit] 5455#0: *1 connect() to unix:/tmp/uwsgi.sock failed (13: Permission denied) while connecting to upstream, client: xx.xx.x.xxx, server: localhost, request: "GET /users HTTP/1.1", upstream: "uwsgi://unix:/tmp/uwsgi.sock:", host: "EC2.amazonaws.com"
Run Code Online (Sandbox Code Playgroud)
浏览器还显示502 Bad Gateway Error.a的输出curl是相同的,Bad Gateway html
我试图通过将权限更改为/tmp/uwsgi.sock777 来修复它.这不起作用.我也把自己加入了www-data小组(一些看似相似的问题).此外,没有骰子.
这是我的nginx.conf档案:
nginx.conf
worker_processes 1;
worker_rlimit_nofile 8192;
events {
worker_connections 3000;
}
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" …Run Code Online (Sandbox Code Playgroud)