Two python app, uwsgi, one IP, nginx

Sergey A. Osokin osa at freebsd.org.ru
Mon Nov 21 13:26:18 UTC 2022


Hi there,

On Mon, Nov 21, 2022 at 06:20:33AM -0500, mfaridi wrote:
> We have one server and we have two python app work by uwsgi and we want use
> Nginx for serve these applications and other users can use these two python
> applications.
> 
> these two python application start on server by this command
> 
> /home/admin/aaa/aaa_en//bin/uwsgi --ini aaa.ini
> and 
> /home/admin/bbb/bbb_env/bin/uwsgi --ini bbb.ini
> 
> I want bbb application use port 8888 and aaa application use port 7777

Here's the minimal configuration for two virtual servers configure on
ports 7777 and 8888:

server {
    listen 7777;

    location / {
        uwsgi_pass http://ip_address_of_aaa:port_of_aaa;
    }
}

server {
    listen 8888;

    location / {
        uwsgi_pass http://ip_address_of_aaa:port_of_bbb;
    }
}

Please take a look on the ngx_http_uwsgi module directives at
http://nginx.org/en/docs/http/ngx_http_uwsgi_module.html

Thank you.

-- 
Sergey A. Osokin



More information about the nginx mailing list