I cannot get n8n to work on my server. I got this websocket error message in console

Describe the problem/error/question

I cannot get n8n to work on my server. I setup using nginx proxy manager and a docker swarm compose

What is the error message (if any)?

From console log
WebSocket connection to 'wss://n8n.dev.mydomain.xyz/rest/push?pushRef=hvrtbju7i2' failed:

Please share your workflow

Share the output returned by the last node

My docker compose

version: "3.8"

services:
  n8n:
    image: docker.n8n.io/n8nio/n8n
    restart: unless-stopped
    ports:
      - target: 5678
        published: 5678
    environment:
      - N8N_HOST=n8n.dev.mydomain.xyz
      - N8N_PORT=5678
      - N8N_PROTOCOL=http
      - N8N_BASIC_AUTH_ACTIVE=true
      - WEBHOOK_URL=https://n8n.dev.mydomain.xyz:5678
    networks:
      - proxy
    volumes:
      - n8n_data:/home/node/.n8n
    deploy:
      replicas: 1
      resources:
        limits:
          cpus: '0.50'
          memory: 220M

networks:
  proxy:
    external: true

volumes:
  n8n_data:

Information on your n8n setup

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

You don’t need :5678 if you use NPM you’ve probably already added it there.

Well I removed it. The main problem is still lying between npm and n8n wss websocket. What is the setup suppose to be?

In your NGINX Proxy Manager Settings does your n8n proxy host (n8n.dev.mydomain.xyz) ‘Advanced’ section have this:

proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_http_version 1.1;
proxy_set_header Host $host;

If not then add it and then Save and Restart NGINX Proxy Manager.

I there a reason you are using networks:

   proxy:
    external: true

If there misconfiguration it could be a reason.

Doesn’t help.

I just remove nginx proxy manager and use traefik instead to avoid all these headace no solutions problem.

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