[Django]-Can I run 3 uwsgi service using different port

3👍

uwsgi_p1.ini for my_project1

[uwsgi]
chdir = /root/my_workplace/my_project1
module = my_project1.wsgi
virtualenv = /root/my_workplace/virtual/my_project1
processes = 2
socket = 127.0.0.1:10001    # **pay attention to this port**
vacuum = true
master = true

nginx_p1.conf for my_project1

server {
listen      8888;  #  use different server_name or listenport
charset     utf-8;
client_max_body_size 75M;

server_name project1.mydomain.com;  #  use different server_name or listenport

location / {
    uwsgi_pass  127.0.0.1:10001;   #  pay attention to here
    include     uwsgi_params;
}
}

==============================

uwsgi_p2.ini for my_project2

[uwsgi]
chdir = /root/my_workplace/my_project2
module = my_project2.wsgi
virtualenv = /root/my_workplace/virtual/project2
processes = 2
socket = 127.0.0.1:10002
vacuum = true
master = true

nginx_p2.conf for my_project2

server {
listen      8889;
charset     utf-8;
client_max_body_size 75M;

server_name project2.mydomain.com;  

location / {
    uwsgi_pass  127.0.0.1:10002;   
    include     uwsgi_params;
}
}

and so on…

Leave a comment