Connection lost problem in my pc

Hello,
I am experiencing a persistent “Connection lost” error on my n8n instance. My workflows are unable to run properly because of this.
I have checked the Chrome Developer Tools and it appears that the WebSocket connection is failing to establish—no WebSocket traffic is visible in the network logs.
This strongly indicates that the necessary headers are not being passed through the reverse proxy (like Nginx) on the server side.
Could you please check and fix the server’s reverse proxy configuration to ensure the “Upgrade” and “Connection” headers are correctly configured to allow WebSocket traffic?
Thank you

Describe the problem/error/question

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:
1 Like

Hi Manisha! You’re absolutely right that this is a WebSocket configuration issue with your reverse proxy. The “Connection lost” error occurs when the proxy doesn’t properly handle WebSocket upgrades that n8n needs for real-time communication.

Here’s what needs to be fixed in your Nginx configuration:

• Add these essential headers to your location block:

```

proxy_set_header Upgrade $http_upgrade;

proxy_set_header Connection “upgrade”;

proxy_http_version 1.1;

```

• Also include these headers for proper WebSocket support:

```

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;

```

• Increase timeout values to prevent WebSocket disconnections:

```

proxy_read_timeout 86400;

proxy_send_timeout 86400;

```

Based on the community discussions at [community.n8n.io]( Reverse PROXY NGINX Problem ) and [dev.to]( Fixing WebSocket Connection Issues with Nginx Reverse Proxy - DEV Community ), this configuration should resolve your WebSocket connection issues. Make sure to restart Nginx after applying these changes!