Need help to resolve :- connection lost in the UI

Hi,
I’m facing an issue with the n8n UI when running the self-hosted community version (n8nio/n8n:1.89.2) on EKS. However, if I use kubectl port-forward to access the service, the UI works fine without any issues.

I’m using an Ingress to expose the service. Below are some of the environment variables I’ve tried setting, but the problem still persists:

- name: N8N_PUSH_BACKEND
  value: "websocket"
- name: N8N_RUNNERS_ENABLED
  value: "true"
- name: VUE_APP_URL_BASE_API
  value: "<value_here>"

Additionally, I’ve noticed that credentials are lost after restarting the pod. I verified that the N8N_ENCRYPTION_KEY is set and does not change between restarts.

Any guidance on how to fix the UI issue through the ingress and ensure persistent credentials would be appreciated!

Thanks!

Hey @kartikm

Your need websockets enabled, am not 100 percent sure on k8s, but after some searching something like this:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: n8n-ingress
  annotations:
    nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
    nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
    nginx.ingress.kubernetes.io/proxy-http-version: "1.1"
    nginx.ingress.kubernetes.io/connection-proxy-header: "upgrade"
    nginx.ingress.kubernetes.io/websocket-services: "<your-n8n-service-name>"   # Optional but helps with older nginx-ingress
    nginx.ingress.kubernetes.io/enable-websockets: "true"                       # Sometimes needed

Similar issues with dockers nginx Connection lost" after upgrade to n8n 1.98.1 using Docker + Nginx (Ubuntu 24.04)

Hopefully that does the trick for ingress, and can help look into the enc key after this too if you’d like.

I know dockers quite well, still touching up on k8s so happy to explore and learn more too :slight_smile:
Samuel

Hi @King_Samuel_David

I have tried above configuration , but getting with below error.
Failed to save resource: (BadRequest) admission webhook “validate.nginx.ingress.kubernetes.io” denied the request: annotation nginx.ingress.kubernetes.io/connection-proxy-header contains invalid value

nginx.ingress.kubernetes.io/connection-proxy-header: “upgrade”
Getting error for this annotation , if i use keep-alive still same error connection lost