Pushbuild

How to give self-hosted n8n the right public webhook URL

n8n builds its webhook URLs from `N8N_PROTOCOL`, `N8N_HOST` and `N8N_PORT`. Behind a reverse proxy that gives the wrong answer, because n8n listens on port 5678 inside while the proxy serves it on 443. The editor then shows URLs that outside services cannot reach, and services that register webhooks get the wrong address.

Get a free written scope

We reply within 20 minutes with a written scope and a mockup of what we’d build.

At a glance

  1. Set the public URL yourselfSet N8N_WEBHOOK_URL to your public address, for example https://n8n.example.com/.
  2. Pass on the original requestOn the last proxy before n8n, set the X-Forwarded-For, X-Forwarded-Host and X-Forwarded-Proto headers.
  3. Check it worksRestart n8n and open a Webhook node.

Set the public URL yourself

  • Set N8N_WEBHOOK_URL to your public address, for example https://n8n.example.com/.
  • N8N_WEBHOOK_URL replaces WEBHOOK_URL, which is deprecated from n8n 2.35.0 and logs a warning.
  • Set N8N_PROXY_HOPS to 1.

Pass on the original request

  • On the last proxy before n8n, set the X-Forwarded-For, X-Forwarded-Host and X-Forwarded-Proto headers.
  • If you also run n8n's instance-level MCP server behind the same proxy, forward its MCP request headers too.
  1. Set the public URL yourself
  2. Pass on the original request
  3. Check it works
The parts of this guide, in order.

Check it works

  • Restart n8n and open a Webhook node. The production URL should start with your public HTTPS address.
  • Activate a workflow with a trigger that registers a webhook, such as Telegram, and confirm events arrive.

Updated 2026-11-09. General guidance, not advice for your situation; we scope each project in writing before any work starts.

What the sources say

What the source saysSource
“That's because n8n runs internally on port 5678 but the reverse proxy exposes it to the web on port 443.”n8n, n8n docs: Configure webhook URLs with reverse proxy
“When running n8n behind a reverse proxy, you must configure the WEBHOOK_URL environment variable with the public URL where your n8n instance is running.”n8n, n8n docs: Telegram Trigger common issues

N8N_WEBHOOK_URL is available from n8n 2.30.0; earlier versions use WEBHOOK_URL (docs.n8n.io, as of 2026-11-17).

Sources

Questions people ask first

Why does the editor still show localhost?

The webhook URL variable is not set, or n8n was not restarted after setting it.

Do I need HTTPS?

Some services require it. Telegram, for example, rejects a webhook address that is not HTTPS.

Which port does n8n listen on?

5678 inside. The reverse proxy usually exposes it on 443, which is why n8n cannot work out the public URL on its own.

Tell us what you need built.

Tell us the process and the tools involved. We reply with questions or a written scope.

hello@pushbuild.com