WooCommerce REST
iibekeen-oss
HOBBYOP

19 days ago

Hello Railway Support Team,

I'm facing a persistent issue with a WordPress/WooCommerce site hosted on Railway. External API requests to WooCommerce REST API fail with "401 Unauthorized", even though the same credentials work perfectly when used directly from a browser.

Setup:

The Problem:

When I try to connect n8n to WooCommerce using the official WooCommerce node, I get:

"Authorization failed - please check your credentials"

What I have already tried and verified:

  1. Created new WooCommerce API keys with Read/Write permissions.

  2. Verified the API keys work directly in the browser (returns valid JSON data):

    https://wordpress-production-343a.up.railway.app/wp-json/wc/v3/products?consumer_key=ck_...&consumer_secret=cs_...

    ✅ This returns valid product JSON, so the keys and endpoint are correct.

  3. Changed WordPress Permalinks to "Post name" (recommended for REST API).

  4. Tried with "Include Credentials in Query" enabled and disabled in n8n.

  5. Tried "Allowed HTTP Request Domains" set to "All" and "Specific Domains".

  6. Tried "Ignore SSL Issues" — no such option found in n8n's WooCommerce node.

  7. Sometimes the connection test shows "Connection tested successfully" but then fails again on Execute Step with 401.

My suspicion:

The issue may be caused by one of the following on Railway's side:

  • Railway's reverse proxy stripping or modifying the "Authorization" HTTP header before it reaches WordPress.
  • A forced HTTP-to-HTTPS redirect that drops the Authorization header.
  • A Web Application Firewall (WAF) blocking n8n's default User-Agent header.

My questions:

  1. Does Railway's proxy or networking layer modify or strip HTTP "Authorization" headers on inbound requests?
  2. Is there any known limitation with WordPress/WooCommerce REST API on Railway that prevents external API authentication?
  3. Can you provide any logs or access to network-level diagnostics to verify whether the Authorization header reaches the WordPress container?
  4. Are there any recommended Railway settings (e.g., disabling redirects, configuring networking, or using a specific service configuration) that would allow WooCommerce REST API authentication to work correctly?

This issue has been blocking my store's automation for days. Any help would be greatly appreciated.

Thank you,

Mojahed Abdelbasit

$10 Bounty

1 Replies

Railway
BOT

19 days ago

This thread has been opened as a bounty so the community can help solve it.

Status changed to Open Railway • 19 days ago


townifiedapp-dot
FREE

19 days ago

Since Railways can tamper with the Authorization header during redirection, the most likely solution is to avoid Basic Auth through Railway's proxy and supply the WooCommerce consumer_key and consumer_secret as query parameters (or configure n8n to send them in the query).


Welcome!

Sign in to your Railway account to join the conversation.

Loading...