‘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!

X-Forwarded-For’ header is set but the Express ‘trust proxy’ s

 https://community.n8n.io/t/x-forwarded-for-header-is-set-but-the-express-trust-proxy-s/51208


Can you try setting N8N_PROXY_HOPS to 1 and see if that works.

Renewing Facebook Graph API token automatically?

 

Mã truy cập dài hạn

https://developers.facebook.com/docs/facebook-login/guides/access-tokens/get-long-lived/

https://community.n8n.io/t/renewing-facebook-graph-api-token-automatically/12867/2

Hi @tomato_planet, I am not aware of a way to automate the renewal of your personal token I am afraid.

However, in many cases this shouldn’t be required. Are you using your token to post on a FB page by any chance? If so, you can first send a request to me/accounts like so:

💡 Double-click a node to see its settings, or paste  into n8n to import it

This returns a page-specific token for each page I have access to for me:

This page-specific token does not expire as per Facebook’s token debugger:

Using this new token you should then be able to interact with your page for an extended period of time via the API.

How to use _embed when using _fields?

 https://wordpress.stackexchange.com/questions/363868/how-to-use-embed-when-using-fields

It is not clear in the documentation, but you need to include the "_links" and "_embedded" as fields to be returned. In addition, I include the _embed parameter, as it does not require a value. As of WordPress 5.4, the resources to embed can be limited by passing a list of link relation names to the _embed parameter, though I have not had success with that when using _fields

Example:

domain.com/wp-json/wp/v2/posts?_fields=link,title,featured_media,_links,_embedded&_embed

Check to be sure that port 22 is enabled before you reload

 https://superuser.com/questions/590600/ufw-is-active-but-not-enabled-why

etting ENABLED=yes in /etc/ufw/ufw.conf did it for me.

$ sudo ufw reload
Firewall not enabled (skipping reload)
$ sudo ufw logging on (showing that @Thomas' solution has no effect for me)
Logging enabled
$ sudo sed -ie 's/ENABLED=no/ENABLED=yes/' /etc/ufw/ufw.conf

Check to be sure that port 22 is enabled before you reload

$ sudo ufw status
Status: active

To                         Action      From
--                         ------      ----
22/tcp                     ALLOW       Anywhere                  

Reload

$ sudo ufw reload
Firewall reloaded

‘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 ...