在emperor模式下uWSGI的安装点不正确

时间:2016-12-22 18:23:46

标签: nginx flask alias uwsgi

我正在为同一个域上的多个应用设置emperor模式,每个应用都有不同的别名。我几乎让它工作,但它没有给出正确的挂载点。

我的emperor.ini文件(在/etc/uwsgi中)是

[uwsgi]
emperor = /etc/uwsgi/vassals

我的测试附庸配置reg_demo.ini(在/etc/uwsgi/vassals中)是:

[uwsgi]
chdir = /usr/share/nginx/wsgi/flask-appbuilder/peds_registry
pyhome = /usr/share/nginx/wsgi/flask-appbuilder/venv
venv = /usr/share/nginx/wsgi/flask-appbuilder/venv
binary-path = /home/gms/Envs/Python/bin/uwsgi
chmod-socket = 666
logto = /etc/uwsgi/test.log
callable = app
module = run
mount: /reg_demo=run.py
socket = /tmp/reg_demo.sock
manage-script-name = true
vacuum = true
env = LC_ALL=en_US.UTF-8
threads = 1
workers = 4 #can be adjusted
master = true
max-requests = 1000
harakiri = 120
buffer-size = 24576
if-env = VIRTUAL_ENV
virtualenv = %(_)
endif =

nginx.conf中定义的别名是:

location /reg_demo {
    include uwsgi_params;
    uwsgi_pass unix:/tmp/reg_demo.sock;
    uwsgi_read_timeout 300;
}

但是,当我启动uwsgi(uwsgi --emperor /etc/uwsgi/emperor.ini)时,我的日志显示:

WSGI app 0 (mountpoint='') ready in 4 seconds on interpreter 0x23dd840 pid: 16690 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 16690)
spawned uWSGI worker 1 (pid: 16693, cores: 1)
spawned uWSGI worker 2 (pid: 16694, cores: 1)
spawned uWSGI worker 3 (pid: 16695, cores: 1)
spawned uWSGI worker 4 (pid: 16696, cores: 1)
  • 与预期的WSGI app 0 (mountpoint='/reg_demo')相反 - 否则,其他所有内容都会正常启动。

因此,当我进入网页时,http://hostname/reg_demo,它 因为它无法根据我的挂载点解析所有引用。Screwy routes on web app munging output

这在非皇帝模式下效果很好,但是,我需要能够部署多个应用程序。

1 个答案:

答案 0 :(得分:0)

知道了!结束语法错误:我有mount: /reg_demo=run.py因为某些愚蠢的原因应该mount = /reg_demo=run.py - 让我感到惊讶的是vim中的语法突出显示...