Hi everyone,
I’m running n8n self-hosted via Docker Compose behind Plesk (Ubuntu 20.04,
Plesk Obsidian 18.0.78), with nginx as reverse proxy in front of Docker.
Setup:
- n8n official Docker image (n8nio/n8n)
- Reverse proxy: Plesk’s nginx (proxying to Apache, then to Docker container
on port 5678) - Domain: subdomain with its own SSL (Let’s Encrypt via Plesk)
Environment variables already set:
N8N_HOST=bot.publicides.com
N8N_PORT=5678
N8N_PROTOCOL=https
WEBHOOK_URL=https://bot.publicides.com/
N8N_SECURE_COOKIE=false
N8N_TRUST_PROXY=true
N8N_PROXY_HOPS=2
N8N_PUSH_BACKEND=sse
N8N_EDITOR_BASE_URL=https://bot.publicides.com/
Nginx additional directives already added:
proxy_read_timeout 300s;
proxy_connect_timeout 300s;
proxy_send_timeout 300s;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection “upgrade”;
proxy_set_header Host $host;
proxy_pass_request_headers on;
Problem:
Any live editor action (Execute previous nodes, Test this trigger, even
just opening the Executions tab) fails with “Problem running workflow —
Lost connection to the server” in the UI.
Docker logs show this repeating error:
Origin header does NOT match the expected origin. (Origin: “undefined”
→ “N/A”, Expected: “undefined” → “undefined”, Protocol: “undefined”)
ResponseError: Invalid origin!
at Push.handleRequest (/usr/local/lib/node_modules/n8n/src/push/index.ts:157:10)
at /usr/local/lib/node_modules/n8n/src/push/index.ts:112:17
at Layer.handleRequest (…router/lib/layer.js:152:17)
…
at /usr/local/lib/node_modules/n8n/src/auth/auth.service.ts:158:18
What I’ve already ruled out:
- Server resources are fine (RAM ~72% used but plenty of headroom, low CPU,
low disk usage) - Not a browser/cache issue — same error in incognito mode, different
browser, different device, and mobile data instead of WiFi - Docker container is up and healthy (docker ps confirms “Up”)
- Webhooks work fine — a manual curl POST to the production webhook URL
returns {“message”:“Webhook call received”} and the workflow executes
correctly end-to-end (confirmed via the target Google Sheet being updated) - Domain is NOT proxied through Cloudflare (DNS only / grey cloud)
So the actual workflow execution via webhook works perfectly — only the
live editor’s WebSocket/SSE push connection fails, seemingly rejected
because of an Origin header mismatch somewhere between nginx and n8n’s
auth service.
Has anyone run into this specific “Invalid origin” push error with
Plesk’s nginx setup? Is there an additional env var or nginx directive
needed to correctly forward/set the Origin header for the push endpoint?
Thanks in advance!