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
Setup
- Docker (n8n latest)
- Reverse proxy via Plesk (nginx)
- Domain:
ai.mydomain.de - No Cloudflare
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;}
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
What I tried
- Switched from WebSocket → SSE (
N8N_PUSH_BACKEND=sse) - Disabled origin check
- Set explicit
Originheaders in nginx - Disabled proxy mode in Plesk
Still getting:
Origin: undefined
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?