Try this in your NGINX/NPM advanced config for the n8n host:
-
WebSocket support
-
proxy_http_version 1.1;
-
proxy_set_header Upgrade $http_upgrade;
-
proxy_set_header Connection “upgrade”;
-
-
Forward original client info
-
proxy_set_header Host $host;
-
proxy_set_header X-Real-IP $remote_addr;
-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
-
proxy_set_header X-Forwarded-Proto $scheme;
-
-
Disable caching/buffering and avoid timeouts
-
chunked_transfer_encoding off;
-
proxy_buffering off;
-
proxy_cache off;
-
proxy_read_timeout 3600;
-
proxy_send_timeout 3600;
-
These settings have resolved the exact “connection lost” symptom for multiple users behind NGINX/NPM and Kubernetes ingress (enable WebSocket support in NPM’s UI if you use it)
You can check here:
- Connection lost using Nginx reverse Proxy, Self hosted with Nginx Proxy Manager
- First Workflow Issue: WebSockets on NGINX, Docker on subpath fix
If you’re on a subpath (e.g., /n8n), also set:
-
N8N_PATH=/n8n/
-
WEBHOOK_URL=https://yourdomain.com/n8n/
-
N8N_HOST=yourdomain.com
-
N8N_PROTOCOL=https . And do not run with the tunnel flag, which overrides webhook URL selection