Upgraded to v1 via docker. Now have "Connection Lost" issue on UI

I changed nothing on my nginx conf.

here is my docker-compose:
version: ‘3’
services:
n8n:
image: n8nio/n8n:next
build:
context: .
dockerfile: Dockerfile
restart: always
ports:
- “5678:5678”
environment:
- N8N_HOST=[my url]
- N8N_PORT=5678
- N8N_PROTOCOL=https
- WEBHOOK_URL=[my url]
- N8N_EDITOR_BASE_URL=[my url]
- DB_SQLITE_VACUUM_ON_STARTUP=true
- N8N_TEMPLATES_ENABLED=false
- EXECUTIONS_DATA_PRUNE=true
- EXECUTIONS_DATA_MAX_AGE=720
- NODE_FUNCTION_ALLOW_BUILTIN=*
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./n8n-data:/root/.n8n

UPDATE: Seems like setting N8N_PUSH_BACKEND= sse fixes it

5 Likes

Thanks for posting your solution, @sockpapi !

n8n v1 uses by default WebSockets, the previous default was ServerSent Events. So setting it temporarily back again to SSE will fix the issue but at some point, the underlying issue has to get solved (the reverse proxy probably needs to be configured accordingly) as we have planned to deprecate SSE in the future.

1 Like

Hey @jan , I thought it was my nginx settings as well but I compared my settings to the ones posted in this forums and they seems to match, here is my conf file:

server {
server_name {{my_url}};

location / {
    proxy_pass http://127.0.0.1:5678; # ip address and port of dockerized n8n
    proxy_set_header Connection '';
    proxy_http_version 1.1;
    chunked_transfer_encoding off;
    proxy_buffering off;
    proxy_cache off;
}

listen 443 ssl; # managed by Certbot
listen [::]:443 ssl;
ssl_certificate /etc/letsencrypt/live/{{my_url}}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{my_url}}/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

}

Need change

    proxy_set_header Connection "Upgrade";

and add

    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Host $host;

It will be works with WebSockets

3 Likes

Thank works, thank you!

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.