Nginx, Django, Gunicorn, Ubuntu 14.04 (13: Erlaubnis verweigert) beim Verbinden mit dem Upstream
Ich arbeite an meinemdjango
Projekt mitnginx
undgunicorn
, wie hier gesagt:
Meine Seite funktioniert lokal, aber wenn ich startenginx
undgunicorn
Server hatte ich
502 Ungültiger Gateway-Fehler.
OS istUBUNTU 14.04
Ich versuche mein Projekt zum Laufen zu bringen und alles als root neu zu installieren (ich weiß, dass es schlecht ist) - der gleiche Fehler.
Hier ist mein "error.log":
2016/04/20 20:15:10 [crit] 10119 # 0: * 1 connect () to
unix: /root/myproject/myproject.sock fehlgeschlagen (13: Berechtigung verweigert) beim Herstellen einer Verbindung zum Upstream, Client: 46.164.23
Wenn ich Kommando "nginx
":
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
Meine gunicorn.conf
description "Gunicorn application server handling myproject" start on runlevel [2345] stop on runlevel [!2345] respawn setuid root setgid www-data chdir /root/myproject exec myprojectenv/bin/gunicorn --workers 3 --bind unix:/root/myproject/myproject.sock myproject.wsgi:application
Thats my "/ etc / nginx / sites-available / myproject"
server {
listen 80;
server_name www.mysite.ru;
error_log /nginx_error.log;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /root/myproject;
}
location / {
include proxy_params;
proxy_pass http://unix:/root/myproject/myproject.sock;
}
}
Ich werde Ihre Hilfe sehr schätzen !!!