Files
nexus/wiki/sources/n8n-Telegram-Trigger-HTTPS配置修复.md
2026-04-16 13:01:42 +08:00

48 lines
1.8 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 配置修复"
type: source
tags: [n8n, telegram, webhook, self-hosted]
date: 2025-12-30
---
## Source File
- [[raw/Agent/n8n configure telegram trigger.md]]
## Summary
- 核心主题n8n Telegram Trigger Webhook HTTPS 报错修复
- 问题域Telegram Webhook 必须使用 HTTPS URL本地/内网部署常见此问题
- 方法/机制:设置 `WEBHOOK_URL` 环境变量为公网 HTTPS 地址
- 结论/价值:解决 "Bad Request: bad webhook: An HTTPS URL must be provided for webhook" 错误
## Key Claims
- Telegram Webhook 模式强制要求 HTTPS URL自签名证书或 HTTP 地址均会拒绝
- `WEBHOOK_URL` 环境变量告知 n8n 生成外部可访问的 Webhook URL
- 使用 cpolar/内网穿透服务可将本地 n8n 实例暴露为 HTTPS 公网地址
## Key Quotes
> "Telegram Trigger: Bad Request: bad webhook: An HTTPS URL must be provided for webhook" — Telegram Bot API 强制约束
## Key Concepts
- [[Telegram Webhook]]: Telegram Bot 与 n8n 通信的回调机制
- [[WEBHOOK_URL]]: n8n 环境变量,定义公网可访问的 Webhook 基础 URL
- [[内网穿透]]: cpolar/FRP 等工具将本地服务暴露到公网
## Key Entities
- [[n8n]]: 开源工作流自动化平台,支持 Telegram Trigger 节点
- [[cpolar]]: 内网穿透服务,将本地端口映射为公网 HTTPS URL
## Connections
- [[n8n-Docker安装与SOCKS5代理配置]] ← relates_to ← [[n8n-Telegram-Trigger-HTTPS配置修复]](同为 n8n 自托管实战)
## Contradictions
- 无已知冲突
## 实战步骤
1. 确保 n8n 实例可通过公网 HTTPS 访问(如使用 cpolar
2. 在 Docker Compose 中设置 `WEBHOOK_URL=https://your-domain.com/`
3. Telegram Trigger 节点重新获取 Webhook URL
4. 验证 Telegram Bot 响应正常
## Tags
- #n8n #telegram #webhook #self-hosted