N8n 1.0.5 websocket "GET /rest/push?sessionId=" Error 401


I’m running n8n since a long time succesfully on the systems of our hosting partner maxcluster.

n8n runs behind an nginx reverse proxy as an npm package. After upgrading to version 1.0.5 and switching to websockets I’ve encountered some issues regarding the session handling.

As far as I debugged it for now, all server request and also the login with my existing user is succesfull. But for a currently unknown reason all calls to “GET /rest/push?sessionId=” getting a 401 and therefore the web ui tells me the server is offline.

I’ve also removed the .n8n folder an started with a fresh instance, but got the same issue.

Do you have any idears or tipps to handle this issue?

Developer Console Js Error

pushConnection.ts:96 WebSocket connection to 'wss://n8n.xxx.xx/rest/push?sessionId=xxxxx' failed:

nginx config

location / {
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
    proxy_set_header Host $host;

Information on your n8n setup

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

Ok, I found the issue. :blush:

To handle htaccess and IP filtering within the admin UI of the hosting system, we placed Varnish (without any rules) before Nginx. However, since Varnish is not able to handle websockets, it fails (even with the workarounds mentioned in the Varnish documentation).

I turned off Varnish and moved the IP filter and htaccess configurations into Nginx.

Now everything is working!


Hi @tniebergall, I am sorry you are having trouble.

I am not overly familiar with nginx (I am using mostly caddy these days), but your configuration looks good to me on first sight. Are there any other components in your network infrastructure possibly interfering with the connection?

The easiest way to verify this would be to simply spin up a n8n instance on your current machine, then open http://localhost:5678, so no network traffic is involved. You should be able to see the execution progress and websocket messages as expected when executing a simple workflow:

If the websocket connections still fail for you even when connecting to local instance, the problem might be with a browser plugin.

If the previous method (server-sent events) was working fine for you, you could alternatively just set the N8N_PUSH_BACKEND=sse environment variable and restart n8n to pick up the change.

1 Like


Thank you for your reply @MutedJam.

As I mentioned in my second Part of the topic, Varnish was the issue in the chain. Because Varnish has no (or no real) support for websockets the connection failes.

After removing varnish in the chain n8n and the websockets are working perfectly.

1 Like

Oh god, I completely overlooked your response. Now I wonder if I was just stupid or was looking at a cached version of the thread :see_no_evil:

Glad to hear this sorted, thanks for confirming :smiley:

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