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. 1. Check the push connection in DevTools

    1. Open browser DevTools > Network and find the /rest/push request
    2. If it doesn't return status 101, your proxy is blocking the WebSocket upgrade
    3. If it connects and then drops, check the push backend and proxy timeouts
  2. 2. Add WebSocket headers to nginx

    1. In the n8n location block add proxy_http_version 1.1
    2. Add proxy_set_header Upgrade $http_upgrade and proxy_set_header Connection "upgrade"
    3. Add proxy_buffering off and a longer proxy_read_timeout
    4. Reload nginx
  3. 3. Set the public URL and proxy variables

    1. Set N8N_EDITOR_BASE_URL and WEBHOOK_URL to your https domain
    2. Set N8N_PROTOCOL=https
    3. Set N8N_PROXY_HOPS to the real number of proxies (usually 1)
    4. Redeploy
  4. 4. Try the SSE push backend

    1. Set N8N_PUSH_BACKEND=sse
    2. Restart n8n
    3. 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