Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Fix n8n 'Connection Lost' and Webhook URLs Behind a Proxy

Описание и применение

После настройки переменных окружения N8N_WEBHOOK_URL и конфигурации прокси для поддержки WebSocket, вебхуки становятся доступными по публичному домену, а редактор сохраняет живое соединение.

Задача

n8n behind a reverse proxy shows a "Connection lost" badge and generates webhook URLs with localhost or internal port, preventing external access.

Результат

After setting N8N_WEBHOOK_URL and configuring the proxy for WebSocket support, webhook URLs are publicly reachable and the editor maintains a live connection.

Рабочий процесс

  • 1. Add environment variables to docker‑compose: N8N_HOST, N8N_PROTOCOL, N8N_WEBHOOK_URL, N8N_PROXY_HOPS=1.
  • 2. Recreate the container with docker compose up -d to apply env vars.
  • 3. Configure the reverse proxy to allow WebSocket upgrades (Upgrade and Connection headers) and preserve the Host header (e.g., enable Websockets Support in Nginx Proxy Manager).
  • 4. Verify webhook URLs in a Webhook node start with the public domain and contain no :5678 port.
  • 5. Confirm the editor no longer shows "Connection lost" and live executions update.

Доказательства

Webhook URLs now read https://n8n.example.com/webhook/… , with no port.

Источник

"Connection lost" in the editor: the proxy has to pass WebSocket upgrades (Upgrade and Connection headers over HTTP/1.1) and keep the original Host.

Источник

  • Дата записи: 2026-10-16T07:55:56.897Z