uWSGI 在 Emperor 模式下 Nginx 无法访问套接字

uWSGI 在 Emperor 模式下 Nginx 无法访问套接字

但当我以单一模式执行时,它运行得很好。

皇帝配置文件

uid = www-data
gid = www-data

#exec-asap = mkdir -p /var/run/uwsgi
#exec-asap = chown -R www-data:www-data /var/run/uwsgi

emperor = /srv/*/uwsgi.ini

vassals-include = /etc/uwsgi/vassals-include.ini

touch-reload = /etc/uwsgi/emperor.ini
touch-reload = /etc/uwsgi/vassals-include.ini

chmod-socket = 770
chown-socket = www-data


stats = /var/run/uwsgi/emperor-stats.sock

auto-procname = true
vacuum = true
workers = 1
logto = /var/log/uwsgi/emperor.log
safe-pidfile = /var/run/uwsgi/emperor.pid

Vassals include.ini

[uwsgi]
logto = /var/log/uwsgi/%N-%C.log
pidfile = /var/run/uwsgi/vassal-%C.pid

stats = /var/run/uwsgi/vassal-%C-stats.sock
chdir = %D

socket = /var/run/uwsgi/vassal-%C.sock

heartbeat = 10
max-requests = 100

subscribe-to = /var/run/uwsgi/fastrouter-sub.sock:%C

unsubscribe-on-graceful-reload = true

应用程序配置文件

[uwsgi]
module=wsgi
enable-threads =true
master= true
processes = 5
socket = app_socket.sock
chmod-socket 755
vacuum = true
plugin = python3
die-on-term = true

Nginx 配置(单一模式下有效)

server {
    listen 80 default_server;
    listen [::]:80 default_server;
    root /var/www/html/hacks;
    location /static{
        alias /var/www/html/hacks/static;
    }
    location /{
        include uwsgi_params;
        uwsgi_pass unix:/var/www/html/hacks/app_socket.sock;
    }
}

基本上,我可能只需要生成多个 uwsgi 进程,每个进程指向不同的配置(作为一种解决方法)。它总是给我一个无法连接到 unix 套接字的错误。

相关内容