title: Configure Nginx to manage multiple servers with the same port
body: <p>given this Nginx configuration:</p>
  
  <pre><code>server {
      listen 8443;
      ssl on;
      server_name _;
      ssl_certificate /etc/nginx/ssl/nginx.crt;
      ssl_certificate_key /etc/nginx/ssl/nginx.key;
  
      location / {
          auth_basic "Web Access";
          auth_basic_user_file /etc/nginx/ssl/nginx.htpasswd;
          proxy_pass http://serverA;
          proxy_http_version 1.1;
          proxy_set_header Upgrade $http_upgrade;
          proxy_set_header Connection 'upgrade';
          proxy_cache_bypass $http_upgrade;
      }
  }
  </code></pre>
  
  <p>Which is basically redirecting every request made towards the <code>https://nginxIP:8443</code> to <code>http://serverA</code>, is it possible to obtain a configuration so that:</p>
  
  <ul>
  <li><a href="https://nginxIP:8443/serverA/" rel="nofollow noreferrer">https://nginxIP:8443/serverA/</a> points to <a href="http://serverA" rel="nofollow noreferrer">http://serverA</a>;</li>
  <li><a href="https://nginxIP:8443/serverB/" rel="nofollow noreferrer">https://nginxIP:8443/serverB/</a> points to <a href="http://serverB" rel="nofollow noreferrer">http://serverB</a>;</li>
  </ul>
  
  <p>And so on</p>