<div dir="ltr">Hi everybody,<div><br></div><div>I'm currently having an issue with nginx which I cannot get to the bottom of.</div><div><br></div><div>I'm using nginx as a reverse proxy/load balancer in front of Kubernetes. I'm trying to set up Websocket connections with an app running in Kubernetes, but there are some problems. I have followed the "more sophisticated" example from <a href="https://nginx.org/en/docs/http/websocket.html" target="_blank">https://nginx.org/en/docs/http/websocket.html</a>.</div><div><br></div><div>The configuration more or less looks like:</div><div><br></div><div>"http {</div><br>  map $http_upgrade $connection_upgrade {<br>    default upgrade;<br>    '' close;<br><div>  }      # building the connection_upgrade variable based on $http_upgrade</div><div>......</div><div><br></div><div><br></div><div>server{</div><div>  listen 443 ssl http2;</div><div>  location / {</div><div>    proxy_http_version 1.1;</div>    proxy_set_header Upgrade $http_upgrade;<br>    proxy_set_header Connection $connection_upgrade;<div>  }</div><div>....<br><div>" </div></div><div>There is also a server { listen 80 } directive there which simply redirects to https.</div><div><br></div><div>If I configure "proxy_set_header Upgrade  Websocket" and "Connection Upgrade", everything works as intended. It seems though that the $http_upgrade variable is seen as empty, even though tcpdump confirms the fact that the Upgrade header is correctly sent to Nginx by the client request. Can somebody please point me towards what could reset this variable or why is it unavailable? I'm thinking some scope issues but I have no idea how to debug.</div><div><br></div><div>Thank you!</div></div>