我正在关注this tutorial来托管django应用程序nginx,但它提供了
502 Bad Getway错误connect()到unix:/tmp/socket.sock失败(111: 连接到上游时拒绝连接。
以下是我的sample.ini
[uwsgi]
project = mysite
base = /home/ubuntu/Arti/Project
chdir = %(base)/%(project)
home = %(base)/Env/%(project)
module = %(project).wsgi:application
master = true
processes = 2
socket = /tmp/%(project).sock
chmod-socket = 666
vacuum = true
以下是我的uwsgi.conf
description "uWSGI"
start on runlevel [2345]
stop on runlevel [06]
respawn
env UWSGI=/usr/local/bin/uwsgi
env LOGTO=/var/log/uwsgi.log
exec $UWSGI --master --emperor /etc/uwsgi/sites --die-on-term --uid django --gid www-data --logto $LOGTO
nginx文件
server {
listen 8087;
server_name 127.0.0.1;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/ubuntu/Arti/Project/mysite/;
}
location / {
include uwsgi_params;
uwsgi_pass unix:/tmp/mysite.sock;
}
}