WebSocket Connection Issues when Deploying ShinyProxy on AKS with Nginx Ingress Controller

Hello,

I am facing an issue while deploying a Shiny application via ShinyProxy in an Azure Kubernetes Service (AKS) environment, using an Nginx ingress controller.

The Shiny application loads, but it seems to have an issue maintaining the WebSocket connection which is required for the interactive components. The browser’s console reports the following error:

WebSocket connection to wss://blablabla.bla/app_proxy/{proxy-id}/websocket/ failed: Error during WebSocket handshake: Unexpected response code: 404

The ShinyProxy is set up correctly and I can see that the shiny app pod is running correctly, without any error logs. The issue seems to come from the ingress controller configuration or interaction with ShinyProxy, but I haven’t been able to identify the exact problem.

I have tried enabling WebSocket support on the ingress controller through the nginx ConfigMap and other configurations, but the issue persists.

If anyone has experienced similar issues or could provide insight into possible solutions or troubleshooting steps, it would be greatly appreciated.

Thank you for your help and time.

Hi

First of all, we have multiple deployments using AKS, so there should be a way to get it to work.
Which ingress controller are you using? There is the one created by the Kubernetes community at https://github.com/kubernetes/ingress-nginx and there is one created by nginx inc at https://github.com/nginxinc/kubernetes-ingress .

The first one should support websockets out of the box, for the second one you should add an annotation to the ingress resource:

nginx.org/websocket-services: "my-shinyproxy-ingress"

Thanks alot for your reply. I figured it out myself in the meantime. I was referring to the wrong nginx in the annotations. What you say is indeed correct.

1 Like