nginx+uswgi+supervisor

Supervisor + + uswgi Nginx
Supervisor:
Add a supervisor.ini configuration, and include the files in the file /etc/supervisord.conf add the path corresponding
EG:
[include]
files = / Home / Coding / Workspace / D_Test / D_Test / supervisor.ini

uwsgi.ini:
[to uwsgi]
; and the path back to the same configuration nginx, will generate a corresponding start test.sock
Socket = /var/tmp/test.sock
the chdir = / Home / Coding / Workspace / D_Test
WSGI-File = D_Test /wsgi.py
Touch-reload = / Home / Coding / Workspace / D_Test / reload
Processes = 2
Threads =. 4
; corresponding to the above permission /var/tmp/test.sock
the chmod-Socket = 777
Vacuum to true =

supervisor.ini:
[program: test]
command = uwsgi --This /home/coding/workspace/D_Test/D_Test/uwsgi.ini
directory = / home / coding / workspace / D_Test
startsecs = 0

Create a website
/etc/nginx/sites-available/test_nginx.conf
Server {
the 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;
}

}
Activation website
sudo ln -s /etc/nginx/sites-available/test_nginx.conf /etc/nginx/sites-enabled/test_nginx.conf

Finally:
Start supervisor at the start nginx
sudo supervisord -c /etc/supervisord.conf
sudo nginx

Guess you like

Origin blog.51cto.com/xuguohongai/2435341