Getting "connection lost" error in a deployed n8n instance

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:

If you’re on a subpath (e.g., /n8n), also set: