<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>I'm attempting to upgrade a WSS request on Varnish 4 via Nginx. <br></div><div><br></div><div>[varnish]</div><div></div><div>sub vcl_recv {</div><div> if (req.http.Upgrade ~ "(?i)websocket") {<br> return (pipe);<br> }</div><div>}</div><div><br></div><div>sub vcl_pipe {<br> if (req.http.upgrade) {<br> set bereq.http.upgrade = req.http.upgrade;<br> }<br>}</div><div><br></div>[nginx]</div><div dir="ltr">server {<br><div> listen 8080 default_server;<br> <br> location /socket {<br> proxy_pass <a href="http://127.0.0.1:8081">http://127.0.0.1:8081</a>;<br> proxy_http_version 1.1;<br> proxy_set_header Upgrade $http_upgrade;<br> proxy_set_header Connection "Upgrade";<br> }</div><div><br></div><div>When initiating a WSS connection the request fails with "426 Upgrade header MUST be provided", although the header is provided by the client.</div><div><br></div><div>When forcing the Upgrade header in Nginx:</div><div><br></div><div>
proxy_set_header Upgrade "websocket";</div><div><br></div><div>The request passes to the backend and produces a new connection, the client however does not receive a response back and times out.</div><div><br></div><div>Is there anything i can do to debug this further?</div><div><br></div><div>Thank you and regards,</div><div>Olivier</div><div><br></div><div><br></div></div></div></div></div></div>