我是配置服务器的新手。我想配置我的 Amazon-EC2 实例。我是按照这个文档配置的。http://www.soundrenalin.com/about
但是,当我单击 url 时,502 Bad Gateway
遇到了错误。我的项目位于此路径:/home/ubuntu/dsn/app
.
文件夹树是
:/home/ubuntu/dsn
app/
app.py
static/
templates/
themes/
bin/
build/
include/
lib/
local/
run.py
这是我的 nginx 配置(/etc/nginx/sites-available/default
):
server {
listen 80;
root /home/ubuntu/dsn/app
index index.html index.htm;
server_name localhost;
location / { try_files $uri @app; }
location @app {
include uwsgi_params;
uwsgi_pass unix:/tmp/uwsgi.sock;
}
}
这是我的uwsgi.ini
文件:
[uwsgi]
chdir = /home/ubuntu/dsn/
uid = www-data
gid = www-data
chmod-socket = 666
socket = /tmp/uwsgi.sock
module = run
virtualenv = /home/ubuntu/dsn/
另一件事是:
当我运行命令tail -f /var/log/nginx/error.log
结果是:
2013/06/09 15:58:11 [error] 5321#0: *1 connect() to unix:/tmp/uwsgi.sock failed (111: Connection refused) while connecting to upstream, client: <myip>, server: localhost, request: "GET / HTTP/1.1", upstream: "uwsgi://unix:/tmp/uwsgi.sock:", host: "54.218.14.213"
我该如何解决这个问题?谢谢。