您好,登录后才能下订单哦!
nginx+uswgi+supervisor
supervisor:
添加一个supervisor.ini配置,然后在/etc/supervisord.conf文件中的include下files添加对应的路径
eg:
[include]
files = /home/coding/workspace/D_Test/D_Test/supervisor.ini
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
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。