nginx+uswgi+supervisor
nginx+uswgi+supervisor
supervisor:
添加一个supervisor.ini配置,然后在/etc/supervisord.conf文件中的include下files添加对应的路径
eg:
[include]
files = /home/coding/workspace/D_Test/D_Test/supervisor.ini
网站建设公司,为您提供网站建设,网站制作,网页设计及定制网站建设服务,专注于企业网站制作,高端网页制作,对成都餐厅设计等多个行业拥有丰富的网站建设经验的网站建设公司。专业网站设计,网站优化推广哪家好,专业网站推广优化,H5建站,响应式网站。
uwsgi.ini:
[uwsgi]
;与后面nginx配置路径要一样,启动时会生成对应的test.sock
socket = /var/tmp/test.sock
chdir = /home/coding/workspace/D_Test
wsgi-file = D_Test/wsgi.py
touch-reload = /home/coding/workspace/D_Test/reload
processes = 2
threads = 4
;对应上面的/var/tmp/test.sock权限
chmod-socket = 777
vacuum = true
supervisor.ini:
[program:test]
command=uwsgi --ini /home/coding/workspace/D_Test/D_Test/uwsgi.ini
directory=/home/coding/workspace/D_Test
startsecs=0
新建一个网站
/etc/nginx/sites-available/test_nginx.conf
server {
listen 8019;
server_name 0.0.0.0;
charset utf-8;
client_max_body_size 75M;
location / {
#与上面uwsgi.ini中的socket一致
uwsgi_pass unix:///var/tmp/test.sock;
include /etc/nginx/uwsgi_params;
}
}
激活网站
sudo ln -s /etc/nginx/sites-available/test_nginx.conf /etc/nginx/sites-enabled/test_nginx.conf
最后:
启动supervisor在启动nginx
sudo supervisord -c /etc/supervisord.conf
sudo nginx
标题名称:nginx+uswgi+supervisor
本文URL:http://ybzwz.com/article/iegedh.html