title: Websocket upgrade response not reaching client through Nginx
body: <p>I have a IOS/swift client connecting to a NodeJS/ws websocket service through a NGINX reverse proxy. All the websocket related forwarding setup is done in the NGINX configuration and websocket service is able to upgrade and setup the websocket connection from the client's upgrade request.</p>
  
  <p>But on the client end, no Response is received for the original http upgrade Request.  </p>
  
  <p>When the websocket terminates the connection after a timeout, the client gets the Response, which is strange.</p>
  
  <p>The NGINX reverse proxy is running in a container on a VM.</p>
  
  <p>I have seen one other question to the exact same issue but did not find any answers. Is this a problem with the proxy running in a container?</p>
  
  <p>"<a href="https://stackoverflow.com/questions/30718771/nginx-not-passing-websocket-upgrade-response-back-to-client">Nginx not passing websocket upgrade response back to client?</a>"</p>
  
  <p>Here is the snippet of my nginx proxy. </p>
  
  <pre><code>server {
  listen       443 ssl;
  server_name  &lt;hidden&gt;;
  ssl          on;
  ssl_certificate     /etc/certs/&lt;hidden&gt;.pem;
  ssl_certificate_key /etc/certs/&lt;hidden&gt;.pem;
  ssl_protocols       SSLv3 TLSv1 TLSv1.1 TLSv1.2;
  ssl_ciphers         HIGH:!aNULL:!MD5;
  
  large_client_header_buffers 8 32k;
  
  location ~^/(?&lt;cluster&gt;[^/]+)/websocket {
      proxy_pass https://&lt;hidden&gt;
      proxy_http_version 1.1;
      set $http_upgrade "websocket";
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
      proxy_set_header FromRP      &lt;hidden&gt;;
      proxy_set_header X-Real-IP   $remote_addr;
      proxy_set_header X-Real-Addr $remote_addr:$remote_port;
      proxy_set_header X-External-URL   $scheme://$host$request_uri ;
      proxy_read_timeout           360;
      access_log  /var/log/nginx/websocket.access.log upstreamlog;
      error_log  /var/log/nginx/websocket.error.log info;
      proxy_buffers 8 32k;
      proxy_buffer_size 64k;
  }
  </code></pre>
  
  <p>}</p>