Files
nexus/wiki/sources/n8n configure telegram trigger.md

40 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "n8n Telegram Trigger 配置HTTPS Webhook 错误修复"
type: source
tags: ['n8n', 'Telegram', 'Webhook', '配置', 'Docker', '故障排除']
date: 2025-03-01
source:
author: shenwei
---
## Source File
- [[raw/Agent/n8n configure telegram trigger.md]]
## Summary
- 核心主题n8n Telegram Trigger 配置时遇到"Telegram Trigger: Bad Request: bad webhook: An HTTPS URL must be provided for webhook"错误的解决方案
- 问题域n8n 本地部署时 Telegram Trigger 无法设置 Webhook需 HTTPS URL
- 方法/机制:在 Docker 环境中设置 `WEBHOOK_URL` 环境变量为 HTTPS 地址(如 `https://n8n.cpolar.top`
- 结论/价值Telegram Webhook 强制要求 HTTPSn8n 本地/内网部署需通过反向代理cpolar/frp/ngrok暴露为 HTTPS URL
## Key Claims
- Telegram Webhook 必须使用 HTTPS URL不支持 HTTP
- n8n 本地部署时,默认生成的 Webhook URL 可能不是 HTTPS
- 解决方案:在 Docker 启动参数中添加环境变量 `WEBHOOK_URL=https://your-domain.com/`
- 配合 cpolar 等内网穿透工具,将本地 n8n 暴露为 HTTPS 外部可访问地址
## Key Concepts
- [[Telegram Webhook]]Telegram Bot 推送消息的 HTTP 回调机制,强制要求 HTTPS
- [[n8n Trigger]]n8n 的事件触发节点Telegram Trigger 用于接收 Telegram Bot 消息
- [[WEBHOOK_URL环境变量]]n8n 运行时环境变量,控制生成 Webhook URL 的协议和域名
## Key Entities
- [[n8n]]:开源工作流自动化平台
- [[Telegram Bot]]:通过 Webhook 接收消息的 Telegram Bot
## Connections
- [[n8n]] ← receives ← [[Telegram Webhook]]
- [[WEBHOOK_URL环境变量]] ← configures ← [[n8n Trigger]]
## Contradictions
- (无已知冲突)