机器重启" unix:/socket/uwsgi.sock失败(13:权限被拒绝),同时连接到上游"

时间:2017-03-21 12:12:36

标签: django sockets nginx

9应用程序通过Centos7上的uwsgi应用程序集成到nginx。 它工作正常,但后来我不得不重新启动我的机器。现在我遇到了以下问题:unix:/socket/uwsgi.sock失败(13:权限被拒绝),同时连接到上游,客户端:10.184.160.9,服务器:10.184.2.231,请求:" GET /&# 34;,upstream:" uwsgi:// unix:/socket/uwsgi.sock:"任何线索?

我的ini文件:

[uwsgi]
chdir = /home/elastic/workspace/ES_Brevetti
wsgi-file = ES_Brevetti/wsgi.py
master = true
processes = 5
uid = nginx
gid = nginx
socket = /socket/uwsgi.sock
chmod-socket = 666
vacuum = true

nginx.conf

upstream django {
server unix:/socket/uwsgi.sock; # for a file socket
#server 127.0.0.1:8001; # for a web port socket (we'll use this first)
}
server {
listen 80;
server_name 10.184.2.231;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
charset utf-8;

location /nuovopatentdb/static {
    alias /home/elastic/workspace/ES_Brevetti/static;
}

location / {
    include         /etc/nginx/uwsgi_params;
    uwsgi_pass      unix:/socket/uwsgi.sock;
}
}

我不知道为什么我会遇到这个问题?

我应该在机器重启的任何时候创建sock文件吗?

Thanx valerio

1 个答案:

答案 0 :(得分:2)

该解决方案正在禁用SElinux“sudo setenforce Permissive”。

非常感谢