部署与运维

Configure webhook URLs with reverse proxy

n8n creates the webhook URL by combining N8N_PROTOCOL, N8N_HOST and N8N_PORT. If n8n runs behind a reverse proxy, that won't work. That's because n8n runs internally on port 5678 but the reverse proxy exposes it to the web on port 443.

When running n8n behind a reverse proxy, it's important to do the following:

  • set the webhook URL manually with the N8N_WEBHOOK_URL environment variable so that n8n can display it in the editor UI and register the correct webhook URLs with external services. (N8N_WEBHOOK_URL replaces the deprecated WEBHOOK_URL; n8n logs a deprecation warning if you still use WEBHOOK_URL.)
  • Set the N8N_PROXY_HOPS environment variable to 1.
  • On the last proxy on the request path, set the following headers to pass on information about the initial request:
  • X-Forwarded-For
  • X-Forwarded-Host
  • X-Forwarded-Proto
bash
export N8N_WEBHOOK_URL=https://n8n.example.com/
export N8N_PROXY_HOPS=1

Refer to Environment variables reference for more information on this variable.

官方原文和授权

本页来自 N8N 英文官方网站固定快照,并转换成 xueai 静态页面。内容以 N8N 持续更新的官方页面为准。

来源、授权与修改

本站保留许可证、固定提交号、社区作者和修改说明,不代表 n8n 对本站背书。

查看许可证查看来源和修改说明