Search code examples
nginxuwsgiubuntu-16.04django-deployment

Django + uWSGI + Nginx (13 Permission denied)


I try to deploy like in this Guide on Ubuntu 16.04. But after all I am receiving 502 bad Gateway an in nginx log i have:

2017/03/03 13:28:08 [crit] 8928#8928: *1 connect() to unix:/run/uwsgi/marigu.sock failed (13: Permission denied) while connecting to upstream, client: 95.67.115.53, 

uwsgi file:

[uwsgi]
project = marigu
uid = pavlo
base = /home/%(uid)

chdir = %(base)/%(project)
home = %(base)/Env/%(project)
module = %(project).wsgi:application

master = true
processes = 5

socket = /run/uwsgi/%(project).sock
chown-socket = %(uid):www-data
chmod-socket = 660
vacuum = true

nginx:

server {
    listen 80;
    server_name marigu.com;

    location = /favicon.ico { access_log off; log_not_found off; }
    location /static/ {
        root /home/pavlo/marigu;
    }

    location / {
        include         uwsgi_params;
        uwsgi_pass      unix:/run/uwsgi/marigu.sock;
    }
}

Plz help.


Solution

  • need to change chmod-socket = 660 to chmod-socket = 664, for me helped