Connection lost: You have a connection issue or the server is down. n8n should reconnect automatically once the issue is resolved

I am also experiencing the same issue and reverting to v. 1.78.1 makes the problem disappear.

I am using NGINX Proxy manager as a reverse proxy. Had to enable websocket support. Then it started working again - also with the latest version 1.80.x

2 Likes

It’s running now (with some up and down trials with grok on the sideline)
Here’s part of the yml:

services:
n8n:
container_name: n8n
image: n8nio/n8n:1.80.3
restart: always
environment:
- N8N_HOST=${N8N_HOST}
- N8N_PROTOCOL=${N8N_PROTOCOL}
- N8N_PORT=5678
- N8N_ENCRYPTION_KEY=${N8N_ENCRYPTION_KEY}
- N8N_PUSH_BACKEND=sse
- N8N_EXPRESS_TRUST_PROXY=true
- DB_TYPE=postgresdb
- DB_POSTGRESDB_PORT=5432
- DB_POSTGRESDB_HOST=n8n-postgres
- DB_POSTGRESDB_DATABASE=n8n
- DB_POSTGRESDB_USER=n8n
- DB_POSTGRESDB_PASSWORD=${POSTGRES_PASSWORD}
- WEBHOOK_URL= => my url
volumes:
- ./n8n/data:/home/node/.n8n
networks:
- n8n-network

n8n-postgres:
container_name: n8n-postgres
image: postgres:15
restart: always
environment:
- POSTGRES_DB=n8n
- POSTGRES_USER=n8n
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
volumes:
- ./n8n/postgresql:/var/lib/postgresql/data
networks:
- n8n-network

nginx-proxy:
container_name: nginx-proxy
image: ‘jc21/nginx-proxy-manager:latest’
restart: always
ports:
- ‘80:80’
- ‘443:443’
- ‘81:81’
volumes:
- ./nginx/data:/data
- ./nginx/letsencrypt:/etc/letsencrypt
networks:
- n8n-network

Hi,

The same settings, particularly N8N_PUSH_BACKEND=sse works for me. Changing the value to websocket will result in the mentioned error.

1 Like

Worked for me, current version 1.80.4, docker, reverse proxy (apache)
N8N_PUSH_BACKEND = sse

Thanks.

1 Like

You must add N8N_PROXY_HOPS =1 (it’s the number of reverse-proxies n8n is running behind). You can suppress N8N_EXPRESS_TRUST_PROXY, i think.

1 Like

Work to me. Thanks

Worked for me, current version 1.81.4, docker, reverse proxy (Nginx), Ubuntu 24.04
N8N_PUSH_BACKEND=websocket

If it still doesn’t work, adjust Nginx to use Websocks.
Edit your n8n’s Nginx configuration.

sudo nano /etc/nginx/sites-available/n8n

Add the following lines to /location

proxy_http_version 1.1; # Required for WebSocket
proxy_set_header Upgrade $http_upgrade; # Required for WebSocket
proxy_set_header Connection "upgrade"; # Required for WebSocket

Save and restart Nginx

sudo nginx -t
sudo systemctl restart nginx

It should work now!

1 Like

where can i find the environment / configuration file in ./public_html/node_modules

to change setting ```
N8N_PUSH_BACKEND=sse

Hi where can i find the configuration file to change this setting?

Hi @Erik_Augustin,

If you use Docker, you can set this in your Docker compose file.

Its an npm install

You can refer to this link for more details, basically it’s just importing the file into the app.

Thanks this works for me

funcionou !