Django + uWSGI + Nginx(13权限被拒绝)

时间:2017-03-03 18:34:27

标签: nginx uwsgi ubuntu-16.04 django-deployment

我尝试在Ubuntu 16.04上像Guide那样进行部署。但毕竟我在nginx日志中收到502坏网关我有:

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文件:

[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帮助。

1 个答案:

答案 0 :(得分:0)

需要将chmod-socket = 660更改为chmod-socket = 664,对我帮助