我正在为同一个域上的多个应用设置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
,它
因为它无法根据我的挂载点解析所有引用。
这在非皇帝模式下效果很好,但是,我需要能够部署多个应用程序。
答案 0 :(得分:0)
知道了!结束语法错误:我有mount: /reg_demo=run.py
因为某些愚蠢的原因应该mount = /reg_demo=run.py
- 让我感到惊讶的是vim中的语法突出显示...