Running n8n 2.6.3 (tested on 2.8.0+ too) on Google Cloud Run with PostgreSQL. The editor shows “Connection lost” due to the origin check in push/index.ts:143 rejecting requests because Cloud Run’s load balancer strips the Origin header.
Logs show:
Origin header does NOT match the expected origin. (Origin: "undefined" -> "N/A", Expected: "undefined" -> "undefined")
ResponseError: Invalid origin!
Env vars I’ve tried (none fix it):
N8N_PUSH_BACKEND=sse
N8N_PROXY_HOPS=1
N8N_EDITOR_BASE_URL=https://my-n8n-url.run.app
N8N_HOST=my-n8n-url.run.app
N8N_PROTOCOL=https
N8N_ENDPOINT_HEALTH=health (fixed the healthz conflict but not this)
N8N_CORS_ORIGIN=*
Cloud Run doesn’t allow custom header injection on its load balancer, so the nginx/Apache “set Origin header” workaround doesn’t apply. Can’t build a custom patched image because the official n8n Docker images currently have corrupted layers (invalid tar header).
Is there an env var to disable the origin check, or is a fix planned?
Hi @emp, Welcome to the n8n community
There’s no env var to disable this. The only real workaround is making sure the Origin header arrives correctly, either through a reverse proxy or an architecture adjustment. If Cloud Run is stripping the header and you can’t change that, then it’s an environment limitation, not an n8n issue.