Recently I\'ve been working on a toy app using Kubernetes. Part of the app is a web server that needs to support WebSockets. Currently, I\'m using port-forwarding to access
From looking at the nginx ingress controller docs and the nginx docs you probably need something like this as an annotation on your Kubernetes Ingress
:
nginx.ingress.kubernetes.io/configuration-snippet: |
proxy_http_version 1.1;
proxy_set_header Upgrade "websocket";
proxy_set_header Connection "Upgrade";
Note that once you add that annotation all of your Ingress
rules will have that snippet in the location
block in your nginx configs. So if you want to ignore it for other rules you will have to create a separate Kubernetes Ingress
.
EDIT:
As per the gist and the Nginx ingress docs