Problem: “Connection Lost” / “Invalid origin” (Docker + Plesk)

Hi everyone,

I’m running n8n in Docker on a server managed via Plesk and I keep getting:

Problem running workflowLost connection to the server

In the logs I also see:

Origin header does NOT match the expected originResponseError: Invalid origin!Origin: undefined

:gear: Setup

  • Docker (n8n latest)
  • Reverse proxy via Plesk (nginx)
  • Domain: ai.mydomain.de
  • No Cloudflare

:puzzle_piece: nginx config (Plesk → Additional nginx directives)

location / {    proxy_pass http://127.0.0.1:5678;    proxy_http_version 1.1;    proxy_set_header Host example.domain.tld;    proxy_set_header Origin https://example.domain.tld;    proxy_set_header Referer https://example.domain.tld;    proxy_set_header X-Forwarded-Host example.domain.tld;    proxy_set_header X-Forwarded-Proto https;    proxy_set_header X-Forwarded-For $remote_addr;    proxy_read_timeout 3600;    proxy_send_timeout 3600;}

:spouting_whale: docker-compose.yml

version: "3.8"services:  n8n:    image: n8nio/n8n:stable    container_name: n8n    restart: unless-stopped    ports:      - "127.0.0.1:5678:5678"    environment:      - NODE_ENV=production      - GENERIC_TIMEZONE=Europe/Berlin      - N8N_BASIC_AUTH_ACTIVE=true      - N8N_BASIC_AUTH_USER=admin      - N8N_BASIC_AUTH_PASSWORD=DEIN_SICHERES_PASSWORT      - N8N_HOST=ai.mydomain.de      - N8N_PORT=5678      - N8N_PROTOCOL=https      - WEBHOOK_URL=https://ai.mydomain.de      - N8N_EDITOR_BASE_URL=https://ai.mydomain.de      - N8N_PROXY_HOPS=1      - N8N_TRUST_PROXY=true      - N8N_DISABLE_ORIGIN_CHECK=true      - N8N_PUSH_BACKEND=sse      - NODE_OPTIONS=--max-old-space-size=1024    volumes:      - /var/docker/n8n/data:/home/node/.n8n    networks:      - ai_netnetworks:  ai_net:    external: true

:thinking: What I tried

  • Switched from WebSocket → SSE (N8N_PUSH_BACKEND=sse)
  • Disabled origin check
  • Set explicit Origin headers in nginx
  • Disabled proxy mode in Plesk

Still getting:

Origin: undefined

:red_question_mark: Question

Has anyone successfully run n8n behind Plesk reverse proxy?

It seems like the Origin header is being stripped before reaching n8n.

Any ideas how to fix this?

Hi @web88, welcome to the n8n community !
I would first make the proxy headers consistent with the real public domain and confirm from the n8n container logs or an access dump whether Origin and Host actually reach n8n, because with the current data I can identify a proxy/header mismatch but not yet prove that Plesk is stripping the header.

Can you confirm whether the real Host /Origin headers are reaching the n8n container, or whether Plesk/nginx is overwriting or removing them before the request gets to n8n?