‘Connection lost’ / ‘Invalid origin!’ Error with n8n >= 1.87.0 behind Cloudflare Tunnel

 https://community.n8n.io/t/solved-connection-lost-invalid-origin-error-with-n8n-1-87-0-behind-cloudflare-tunnel/99913/1

The Solution: The solution was to instruct Cloudflare to explicitly set the Origin header to the correct value before the request reaches your tunnel and thus n8n. This was achieved using a Cloudflare Transform Rule:

  1. In the Cloudflare Dashboard, navigate to your domain → Rules → Transform Rules.
  2. Create a “Modify Request Header” rule.
  3. Filter: Hostname equals n8n.example.com
  4. Modification: Set static Header Origin to https://n8n.example.com
  5. Deploy the rule.

After this rule was active, the Origin header was correctly transmitted to n8n, and the Invalid origin! error, along with the ‘Connection lost’ message, disappeared immediately.

I hope this helps others who encounter a similar issue when running n8n behind a Cloudflare Tunnel!

Không có nhận xét nào:

‘Connection lost’ / ‘Invalid origin!’ Error with n8n >= 1.87.0 behind Cloudflare Tunnel

 https://community.n8n.io/t/solved-connection-lost-invalid-origin-error-with-n8n-1-87-0-behind-cloudflare-tunnel/99913/1 The Solution:  The ...