[Answer]-Multiple app on nginx with specific port

1๐Ÿ‘

I have solution. The problem was in the header location.

I had need to use proxy_redirect header like this.

upstream my_app_2318 {
   server unix:/tmp/gunicorn-2318.sock    fail_timeout=10s
}
   server {
       listen                *:2318;
       server_name           example.com;

       index  index.html index.htm index.php;

       access_log            /opt/2318/logs/nginx_access.log combined;
       error_log             /opt/2318/logs/nginx_error.log;

       location / {
           proxy_pass            http://my_app_2318;
           proxy_redirect        http://example.com/ http://example.com:2318/;
           proxy_read_timeout    90;
           proxy_connect_timeout 90;
       }
}
๐Ÿ‘คWilly Konguem

Leave a comment