Nginx Ingress Can't enable Websocket

Team -
Linkerd version - edge-25.4.1
AKS Cluster

  1. Created namespace linkerd
  2. Installed linkerd CRDs from the helm chart [kept the default values]
  3. Installed Linkerd from the helm chart [kept the default values] with in the namespace linkerd
  4. Created namespace linkerd-viz
  5. Installed linkerd-viz from helm chart [kept the default values] with in the namespace linkerd-viz

All pods are in the running state.

Installed and configured the Nginx Ingress contoller.

Installed the Ingress resource, so that Linkerd-viz dashboard can be accessed through Ingress, instead of port-forwarding.

We are able to access Linkerd-viz dashboard from ingress as well.

https://mydomain.com/

Now, from here the issue starts -
On the Linked-viz dashboard, when we click on Namespaces (in the left pane), we get a list of Namespaces on the right pane.
If we click on the linkerd namespace for example, we get a list of Deployements, pods etc.

With in the Deployements, if we click the sub-links “linkerd-destination” for example, we are getting error message,

An error has occurred. Websocket error: undefined, because of that we are unable to see any live calls.

This is happening for all the sublinks when we are accesing the ,linkerd-viz dashboard through ingress.

Everything work perfectly fine, when we access the dashboard through the direct connection (ie port forwarding → http://localhost:8084)

wss://mydomain.com/api/tap’ failed:

we see above error, when we perform from the dashboard , right-click → inspect → Console

Attached the error screen shot and the ingress resource yaml file for you reference.

 
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/auth-realm: Authentication Required
    nginx.ingress.kubernetes.io/auth-secret: web-ingress-auth
    nginx.ingress.kubernetes.io/auth-type: basic
    nginx.ingress.kubernetes.io/backend-protocol: HTTP
    nginx.ingress.kubernetes.io/connection-proxy-error: keep-alive
    nginx.ingress.kubernetes.io/connection-proxy-header: keep-alive
    nginx.ingress.kubernetes.io/enable-websocket: 'true'
    nginx.ingress.kubernetes.io/proxy-buffering: 'off'
    nginx.ingress.kubernetes.io/proxy-connect-timeout: '6000'
    nginx.ingress.kubernetes.io/proxy-http-version: '1.1'
    nginx.ingress.kubernetes.io/proxy-read-timeout: '6000'
    nginx.ingress.kubernetes.io/proxy-send-timeout: '6000'
    nginx.ingress.kubernetes.io/proxy-websocket: 'true'
    nginx.ingress.kubernetes.io/proxy_set_header.Connection: Upgrade
    nginx.ingress.kubernetes.io/proxy_set_header.Upgrade: websocket
    nginx.ingress.kubernetes.io/rewrite-target: /
    nginx.ingress.kubernetes.io/server-snippets: |
      location / {
        proxy_set_header Upgrade $http_upgrade;
        proxy_http_version 1.1;
        proxy_set_header X-Forwarded-Host $http_host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header Connection "Upgrade";
        proxy_cache_bypass $http_upgrade;
        proxy_pass http://web:8084;
        proxy_set_header Upgrade websocket;   
      }
    nginx.ingress.kubernetes.io/upstream-vhost: web.linkerd-viz.svc.cluster.local:8084
    nginx.ingress.kubernetes.io/use-forwarded-headers: 'true'
    nginx.ingress.kubernetes.io/websocket-services: web
    nginx.org/websocket-services: web
  name: web-ingress
  namespace: linkerd-viz
spec:
  ingressClassName: nginx
  rules:
    - host: mydomain.com
      http:
        paths:
          - backend:
              service:
                name: web
                port:
                  number: 8084
            path: /
            pathType: Prefix
  tls:
    - hosts:
        - mydomain.com
      secretName: aks-ingress-tls

 

Please suggest.

We resolved it and we are good with this.

We have removed all previously added annotations and added below annotations and now we are not reciving any websocket error.

nginx.ingress.kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/websocket-services: web
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/cors-allow-methods: "GET, PUT, POST, DELETE, OPTIONS"
nginx.ingress.kubernetes.io/proxy-body-size: 10m