Nginx ingress controller websocket support Nginx ingress controller websocket support kubernetes kubernetes

Nginx ingress controller websocket support


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 📄, it seems like this annotation fixed the problem:

nginx.ingress.kubernetes.io/proxy-read-timeout: 3600nginx.ingress.kubernetes.io/proxy-send-timeout: 3600


Theese worked for me.

It seems they added support via annotation (example in docs):

nginx.org/websocket-services: "service1[,service2,...]"

I tested my connection with telsocket, small tool to connect to a WS/WSS socket.

There are all sorts of different clients, this might also help finding the culprit with the connection.