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

## At a glance

**Set the public URL yourself**Set `N8N_WEBHOOK_URL` to your public address, for example `https://n8n.example.com/`.

**Pass on the original request**On the last proxy before n8n, set the `X-Forwarded-For`, `X-Forwarded-Host` and `X-Forwarded-Proto` headers.

**Check it works**Restart 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 says | Source |
|---|---|
| “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](https://docs.n8n.io/deploy/host-n8n/configure-n8n/basic-configuration/configuration-examples/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](https://docs.n8n.io/integrations/builtin/trigger-nodes/n8n-nodes-base.telegramtrigger/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

- [n8n docs: Configure webhook URLs with reverse proxy](https://docs.n8n.io/deploy/host-n8n/configure-n8n/basic-configuration/configuration-examples/configure-webhook-urls-with-reverse-proxy) (checked 2026-11-17)
- [n8n docs: Telegram Trigger common issues](https://docs.n8n.io/integrations/builtin/trigger-nodes/n8n-nodes-base.telegramtrigger/common-issues/) (checked 2026-11-17)

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

## Read next

[**n8n**](https://pushbuild.com/tools/n8n.html)[**n8n Telegram Trigger not firing**](https://pushbuild.com/guides/n8n-telegram-trigger-not-firing.html)[**n8n webhook test vs production URL**](https://pushbuild.com/guides/n8n-webhook-test-url.html)

## 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](mailto:hello@pushbuild.com?subject=Automation%20question)

---
As of 2026-12-03. Source: https://pushbuild.com/guides/n8n-webhook-url-reverse-proxy.html
