October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

Why n8n Webhooks Fail Behind a Reverse Proxy—and How to Fix Them

If an n8n webhook shows localhost or fails behind a reverse proxy, check the public webhook URL, proxy-hop count, forwarded headers, and whether you need the test or production endpoint.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If n8n shows a webhook URL with localhost, an internal hostname, or the wrong port, the usual problem is a mismatch between the address n8n derives for itself and the public address your reverse proxy exposes. Set n8n’s public webhook base URL, configure the number of proxy hops correctly, and make sure the last proxy forwards the original request headers. Then confirm you are using the test or production URL that matches the workflow’s state.

Why the webhook URL is wrong behind a proxy

By default, n8n constructs webhook URLs from N8N_PROTOCOL, N8N_HOST, and N8N_PORT. Those settings can describe n8n’s internal connection rather than the address an external service can reach. For example, n8n might listen on port 5678 inside your network while the reverse proxy presents the service over HTTPS on port 443. If the editor advertises the internal host, HTTP instead of HTTPS, or an internal port, a caller may send the webhook request to the wrong destination.

# Preview Product Price
1 Island PRO Router Island PRO Router $1,093.20

As an Amazon Associate I earn from qualifying purchases.

n8n’s recommended approach is to set the public webhook URL explicitly, tell n8n how many reverse proxies sit in the request path, and have the final proxy pass the original request details in forwarded headers. See n8n’s reverse-proxy webhook URL documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Set the public webhook URL and proxy-hop count

Configure N8N_WEBHOOK_URL as the externally reachable base URL, not the internal address or port n8n uses to listen. The following values are examples; replace the hostname and hop count to match your deployment:

#1 Best Overall
Island PRO Router
  • UPC: 198715002478
  • Weight: 9.450 lbs
N8N_WEBHOOK_URL=https://n8n.example.com/
N8N_PROXY_HOPS=1

N8N_PROXY_HOPS must equal the actual number of reverse proxies between the incoming request and n8n. A one-proxy example is not correct for every setup: if traffic passes through a load balancer and then another reverse proxy before reaching n8n, count both hops. n8n explains the setting in its deployment environment variables documentation.

The variable name is version-sensitive. Current n8n documentation identifies N8N_WEBHOOK_URL as the current setting and says the older WEBHOOK_URL name is deprecated starting with n8n 2.35.0. The older alias still works but logs a deprecation warning. If an older guide recommends it, check your deployed n8n version and startup logs, and prefer the current name.

Check forwarded headers at the last proxy

The final proxy in the request path—the one that sends the request to n8n—should forward these headers:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • X-Forwarded-For
  • X-Forwarded-Host
  • X-Forwarded-Proto

They convey the original client address, public hostname, and request scheme. If those details are missing or incorrect, n8n may not have the request context it needs when handling a request behind the proxy. Use your proxy’s documentation to verify how it sets or passes these headers; exact directives depend on the proxy product and routing topology.

Troubleshoot in this order

  1. Compare the displayed URL with the public address. Copy the webhook URL shown by n8n and check its scheme, hostname, port, and any path prefix against the URL reachable from outside your network. If it advertises an internal address, configure N8N_WEBHOOK_URL with the public base URL.
  2. Count the proxy hops. Trace the request from the client to n8n, count each reverse proxy in that path, and set N8N_PROXY_HOPS to that count.
  3. Verify forwarded headers on the final hop. Check that the proxy directly in front of n8n forwards X-Forwarded-For, X-Forwarded-Host, and X-Forwarded-Proto with the correct values.
  4. Check that you are calling the right webhook URL for the workflow state. Test and production webhooks have different registration conditions, explained below.
  5. Collect details before changing proxy-specific settings. If the URL looks correct but requests still fail, note your exact n8n version, proxy product and relevant configuration, public URL, proxy-hop count, HTTP status, and relevant logs. Those details are needed to narrow down a routing or request-handling problem.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Make sure the workflow is listening for the URL you are calling

A correctly configured public URL does not make test and production webhooks interchangeable. n8n registers them under different workflow conditions:

Test URL

Use the test URL while listening for a test event or executing an inactive workflow. The test endpoint is registered during that listening or execution period; it is not the URL to rely on as a permanently active production endpoint. See n8n’s Webhook node documentation.

Production URL

Use the production URL after publishing the workflow. Production webhooks register when the workflow is published. If a caller is still using the test URL, or the workflow has not been published, a request can fail even though the proxy-generated address is correct. n8n describes this behavior in its Webhook node documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why there is no universal Nginx or other proxy snippet

There is no safe set of one-size-fits-all directives for Nginx, Traefik, Caddy, or a cloud load balancer without knowing how your hostnames, paths, TLS termination, and proxy hops are arranged. Start with the public base URL, accurate hop count, forwarded headers, and webhook registration state. For a product-specific diagnosis, include the proxy product and relevant routing configuration along with the status code and logs; the correct directives depend on that setup.

Quick Recap

Bestseller No. 1
Island PRO Router
Island PRO Router
UPC: 198715002478; Weight: 9.450 lbs
$1,093.20

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.