Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Nginx+uswgi+supervisor

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

nginx+uswgi+supervisor

supervisor:

Add a supervisor.ini configuration, and then add the corresponding path under files in/etc/supervisor.conf file

eg:

[include]

files = /home/coding/workspace/D_Test/D_Test/supervisor.ini

uwsgi.ini:

[uwsgi]

; The same as the nginx configuration path, the corresponding test.sock will be generated when starting

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

The requested URL/tmp/test.sock was not found on this server.

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

create a new web site

/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 / { #Consistent with socket in uwsgi.ini above uwsgi_pass unix:///var/tmp/test.sock; include /etc/nginx/uwsgi_params;}

}

Activate website

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

Finally:

Start supervisor at start nginx

sudo supervisord -c /etc/supervisord.conf

sudo nginx

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report