我有以下配置:
[uwsgi]
vhost = true
plugins = python,logfile
socket = /tmp/mysite.com.sock
master = true
enable-threads = true
processes = 4
wsgi-file = /home/ubuntu/myappwebsite/myapp/myapp/wsgi.py
chdir = /home/ubuntu/myappwebsite/myapp
touch-reload = /home/ubuntu/myappwebsite/myapp/myapp/reload
logger=file:/tmp/uwsgi-error.log
vacuum = true
和nginx:
server {
listen 80;
server_name mysite.com www.mysite.com;
access_log /var/log/nginx/mysite.com_access.log;
error_log /var/log/nginx/mysite.com_error.log;
client_max_body_size 75M;
location / {
uwsgi_pass unix:///tmp/mysite.com.sock;
include uwsgi_params;
}
}
当我查看nginx日志时,我会看到以下内容:
2016/11/14 01:36:43 [error] 10779#10779: *9 connect() to unix:///tmp/mysite.com.sock failed (111: Connection refused) while connecting to upstream, client: 10.13.142.61, server: mysite.com, request: "GET / HTTP/1.1", upstream: "uwsgi://unix:///tmp/mysite.c
我在uwsgi日志文件中收到以下内容:
Mon Nov 14 02:08:22 2016 - unable to find logger file
由于某些奇怪的原因,我无法在uwsgi日志中找到任何问题。我还有什么别的吗?如果有帮助,我将使用EC2和Ubuntu 16.04。我用Google搜索并重新配置了这个,但仍无济于事。请,任何帮助表示赞赏!
答案 0 :(得分:0)
确保wsgi file
的所有者与nginx用户相同。
chown www-data:www-data wsgi.py