您好,登錄后才能下訂單哦!
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進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。