title: nginx config with multiple web socket appication
body: <p>I have a question on setting nginx
  I have multiple nestjs application for API and I am going to add web-socket service inside it. However, I cannot setup the proxy so it can pass the nginx to websocket.</p>
  <p>I have only one domain and need to serve multiple website and I setup like below
  <a href="https://server.com/appa" rel="nofollow noreferrer">https://server.com/appa</a> =&gt; application a
  <a href="https://server.com/appb" rel="nofollow noreferrer">https://server.com/appb</a> =&gt; application b
  Later application a abd b will also have web socket service</p>
  <pre><code>{
  server {
     listen 80;
     listen 443  ssl;
     server_name  server.com;
  
     ssl_certificate /crt.crt;
     ssl_certificate_key /rsa.rsa;
  
     access_log /var/log/nginx/access.log;
     client_max_body_size 600M;   l
     location /appa {
       proxy_http_version 1.1;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header HOST $host;
       proxy_set_header X-NginX-Proxy true;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection 'upgrade';
       proxy_cache_bypass $http_upgrade;
  
       proxy_pass http://192.168.1.196:9200/v1;
       proxy_redirect off;
  
       # prevents 502 bad gateway error
       proxy_buffers 8 32k;
       proxy_buffer_size 64k;
     }
     location /b {
       proxy_http_version 1.1;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header HOST $host;
       proxy_set_header X-NginX-Proxy true;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection 'upgrade';
       proxy_cache_bypass $http_upgrade;
  
       proxy_pass http://192.168.1.196:9100/v1;
       proxy_redirect off;
  
       # prevents 502 bad gateway error
       proxy_buffers 8 32k;
       proxy_buffer_size 64k;
     }
  }
  </code></pre>
  <p>Current I can only connect under IP (<a href="http://192.168.1.196:9200/socket.io" rel="nofollow noreferrer">http://192.168.1.196:9200/socket.io</a>) but cannot through the domain (<a href="https://server.com/appa/socket.io" rel="nofollow noreferrer">https://server.com/appa/socket.io</a>)</p>
  <p>Am I missing something? or I cannot do something like that?</p>