n8n Connection Lost Error
Workaround available Self-hosted (nginx, Traefik, Plesk, Railway); occasionally n8n Cloud Updated October 21, 2026
Quick answer
'Connection lost' in the n8n editor usually means the browser's push connection (WebSocket) is blocked by a reverse proxy or rejected for an origin mismatch. Add WebSocket upgrade headers to your proxy and set the public URL and proxy hop variables.
Most likely fix: Check the push connection in DevTools.
Symptoms
A 'Connection lost' or 'Lost connection to the server' banner appears in the editor, manual executions hang while triggers still run, and logs show 'Invalid origin!'.
Why it happens
- Reverse proxy not forwarding WebSocket Upgrade/Connection headers
- Origin mismatch because public URL variables aren't set
- Wrong N8N_PROXY_HOPS value
- Instance restarting after running out of memory
How to fix it
Try these in order — the most common fix is first.
1. Check the push connection in DevTools
- Open browser DevTools > Network and find the /rest/push request
- If it doesn't return status 101, your proxy is blocking the WebSocket upgrade
- If it connects and then drops, check the push backend and proxy timeouts
2. Add WebSocket headers to nginx
- In the n8n location block add proxy_http_version 1.1
- Add proxy_set_header Upgrade $http_upgrade and proxy_set_header Connection "upgrade"
- Add proxy_buffering off and a longer proxy_read_timeout
- Reload nginx
3. Set the public URL and proxy variables
- Set N8N_EDITOR_BASE_URL and WEBHOOK_URL to your https domain
- Set N8N_PROTOCOL=https
- Set N8N_PROXY_HOPS to the real number of proxies (usually 1)
- Redeploy
4. Try the SSE push backend
- Set N8N_PUSH_BACKEND=sse
- Restart n8n
- If you then see invalid-origin errors on Traefik, enable WSS in the proxy instead
This guide also covers
- n8n connection lost
- n8n lost connection to the server
- n8n invalid origin
- n8n websocket nginx
Still not working?
If n8n keeps failing, you're not alone. See every n8n problem users report or the alternatives people switch to.
Other n8n errors
- n8n Webhook Not Registered (404 Error)
- n8n Webhook URL Shows localhost
- n8n Out of Memory (JavaScript Heap Out of Memory)
- n8n Executions Stuck in Queued / Starting Soon
- n8n Google OAuth redirect_uri_mismatch Error
- n8n Schedule Trigger Running at the Wrong Time
- n8n 'Cannot Read Properties of Undefined' Error
- n8n Workflows Broken After 2.0 Update
- n8n Cloud Workspace Offline (503 Error)