Zero Trust / SASE
Cloudflare Tunnel
让内网服务通过 outbound-only 隧道接入 Cloudflare,无需暴露公网 IP。
适合场景
内网应用发布、私有 API、SSH/RDP、家庭实验室
Wrangler 配置
# ~/.cloudflared/config.yml (不是 wrangler)
tunnel: my-tunnel
credentials-file: /etc/cloudflared/cred.json
ingress:
- hostname: app.example.com
service: http://localhost:3000
- service: http_status:404 Worker 代码
# 启动隧道(生产用 systemd / docker 跑常驻)
cloudflared tunnel run my-tunnel 实现注意事项
- ● outbound-only;内网不需要开 inbound 端口
- ● 和 Access 搭配才形成完整 Zero Trust 入口;裸 Tunnel 公开有风险
- ● 证书文件不要进 git;用 systemd 环境变量或 secret 管理
已复制