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.
But on the client end, no Response is received for the original http upgrade Request.
When the websocket terminates the connection after a timeout, the client gets the Response, which is strange.
The NGINX reverse proxy is running in a container on a VM.
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?
"Nginx not passing websocket upgrade response back to client?"
Here is the snippet of my nginx proxy.
server {
listen 443 ssl;
server_name <hidden>;
ssl on;
ssl_certificate /etc/certs/<hidden>.pem;
ssl_certificate_key /etc/certs/<hidden>.pem;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
large_client_header_buffers 8 32k;
location ~^/(?<cluster>[^/]+)/websocket {
proxy_pass https://<hidden>
proxy_http_version 1.1;
set $http_upgrade "websocket";
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header FromRP <hidden>;
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;
}
}