下载和安装
curl -L ‘https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64’ -o ./cloudflared-linux-amd64
280 chmod +x ./cloudflared-linux-amd64
281 ./cloudflared-linux-amd64
282 mv cloudflared-linux-amd64 cloudflared
配置
285 ./cloudflared tunnel login
287 ./cloudflared tunnel create web
288 ./cloudflared tunnel route dns web XXX.YYYY.com
289 vim ~/.cloudflared/config.yml
tunnel: [uuid]
credentials-file: /root/.cloudflared/[uuid].json
protocol: http2
ingress:- hostname: XXX.YYYY.comservice: http://127.0.0.1:8999- service: http_status:404
测试
292 ./cloudflared tunnel ingress validate
294 ./cloudflared --loglevel debug --transport-loglevel warn --config ~/.cloudflared/config.yml tunnel run [uuid]
启动服务
298 ./cloudflared service install
299 systemctl start cloudflared