I updated n8n to 1.5 im getting connection lost

Hello!

I stumbled upon the same issue after updating to version 1.0.5.

I’ve installed n8n with npm and am using NGINX reverse proxy.

Adding the following to my n8n’s sites-enabled config fixed the websocket connection issue for me:

    # Main location block with added Websockets support
    location / {
        proxy_pass http://nn_backend;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        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;
        proxy_set_header X-Frame-Options SAMEORIGIN;
        proxy_buffers 256 16k;
        proxy_buffer_size 16k;
        client_max_body_size 50m;
        client_body_buffer_size 1m;
        proxy_read_timeout 600s;
        proxy_buffering off;
        proxy_cache off;
    }

    # Webhook location block with added Websockets support
    location ~ ^/(webhook|webhook-test) {
        proxy_set_header Connection '';
        chunked_transfer_encoding off;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        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;
        proxy_set_header X-Frame-Options SAMEORIGIN;
        proxy_buffering off;
        proxy_cache off;
        proxy_pass http://nn_backend;
    }

Since you were not sure how to add websocket support in the config of nginx, I hope this would help other people using n8n 1.x.x without issues.

Cheers!

7 Likes