部署 CloudFlare Argo Tunnel
为什么用CloudFlare Argo Tunnel?
旧的部署方式
Web application <- Nginx proxy <- Router NAT <- Iptables proxy <- CloudFlare CDN -> Browser
Web应用IP:8001 <- Nginx应用IP:80 <- 家用宽带IP:8000 <- VPS IP:80 <- CF IP -> 用户IP
新的部署方式
Web application <- Nginx proxy <- cloudflared <- CloudFlare CDN -> Browser
Web应用IP:8001 <- Nginx应用IP:80 <- CF IP <- CF IP -> 用户IP
部署步骤
1. 💰开通Argo💰
每个月5刀,免费1G流量,超出1G 0.1刀
💰💰💰
2. 下载cloudflared
# Debian wget -q https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb && dpkg -i cloudflared-linux-amd64.deb # Redhat wget -q https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-x86_64.rpm && rpm -i cloudflared-linux-x86_64.rpm
|
3. 配置cloudflare
cloudflared tunnel login cloudflared tunnel create <NAME>
|
vim ~/.cloudflare/config.yaml
|
url: https://localhost:8000 tunnel: <Tunnel-UUID> credentials-file: /root/.cloudflared/<Tunnel-UUID>.json no-tls-verify: True #忽略证书错误
|
cloudflared tunnel route dns <UUID or NAME> <hostname>
|
cloudflared tunnel run <UUID or NAME>
|