Я пытался настроить django поверх nginx и uwsgi, и при попытке доступа к локальному хосту возникает ошибка 502 bad gateway
. Это мой /etc/ngingx/sites -доступный/файл по умолчанию
server {
server_name testapp1.com www.testapp1.com;
access_log /var/log/nginx/testapp1.com.access.log;
location / {
uwsgi_pass unix:///var/run/uwsgi/app/testapp1/socket;
include uwsgi_params;
}
}
Это мой файл testapp1.ini в /etc/nginx/apps -available/
[uwsgi]
thread=3
master=1
env = DJANGO_SETTINGS_MODULE=testapp1.settings
module = django.core.handlers.wsgi:WSGIHandler()
chdir = /home/paul/apps/testapp1
socket = /run/uwsgi/testapp1/socket
logto = /var/log/uwsgi/testapp1.log
Это файл uwsgi.log
Tue Jul 10 21:49:38 2012 - *** Starting uWSGI 1.0.3-debian (32bit) on
[Tue Jul 10 21:49:38 2012] *** Tue Jul 10 21:49:38 2012 - compiled
with version: 4.6.2 on 20 February 2012 10:06:16 Tue Jul 10 21:49:38
2012 - current working directory: / Tue Jul 10 21:49:38 2012 - writing
pidfile to /run/uwsgi/app/testapp1/pid Tue Jul 10 21:49:38 2012 -
detected binary path: /usr/bin/uwsgi-core Tue Jul 10 21:49:38 2012 -
setgid() to 33 Tue Jul 10 21:49:38 2012 - setuid() to 33 Tue Jul 10
21:49:38 2012 - your memory page size is 4096 bytes Tue Jul 10
21:49:38 2012 - uwsgi socket 0 bound to UNIX address
/run/uwsgi/app/testapp1/socket fd 5 Tue Jul 10 21:49:38 2012 - bind():
No such file or directory [socket.c line 107]
. Я не менял файл nginx.conf.