We have 3 Jenkins instances for DEV/STG/PRD in a single CI Server. It uses 3001,3002 and 3003 TCP ports for each. For example, If I want to access STG Jenkins, I can access the server with the URL "192.168.0.3:3002".
But now we have to move the Jenkins instances to behind Nginx Server for remote users, the users only can access the Jenkins through Nginx and port no 443. Only TCP 443 port of their Fire Wall is opened for outbound traffic. Because of this reason(Single Nginx instance of TCP 443), the only way to distinguish between DEV/STG/PRD is to use different URI.
- "192.168.0.3:3001" --> "192.168.0.3:443/dev"
- "192.168.0.3:3002" --> "192.168.0.3:443/stg"
- and so on.
Below is a sample NginX configuration for port forward I expect.
server ( listen 443; server_name localhost; location /dev ( proxy_pass http://localhost:3001; ) location /stg ( proxy_pass http://localhost:3002; ) location /prd ( proxy_pass http://localhost:3003; ) )
Is it possible? Does Nginx support multiple ports forward with a single instance?