惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 叶小钗
云风的 BLOG
云风的 BLOG
G
Google Developers Blog
S
SegmentFault 最新的问题
罗磊的独立博客
Hugging Face - Blog
Hugging Face - Blog
美团技术团队
爱范儿
爱范儿
博客园 - 三生石上(FineUI控件)
H
Hackread – Cybersecurity News, Data Breaches, AI and More
D
DataBreaches.Net
F
Fortinet All Blogs
TaoSecurity Blog
TaoSecurity Blog
D
Docker
C
Cybersecurity and Infrastructure Security Agency CISA
K
Kaspersky official blog
宝玉的分享
宝玉的分享
腾讯CDC
Google Online Security Blog
Google Online Security Blog
Recorded Future
Recorded Future
T
The Exploit Database - CXSecurity.com
T
The Blog of Author Tim Ferriss
V
V2EX
S
Securelist
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
C
CERT Recently Published Vulnerability Notes
A
Arctic Wolf
Scott Helme
Scott Helme
L
LINUX DO - 热门话题
Y
Y Combinator Blog
P
Proofpoint News Feed
T
Tor Project blog
AWS News Blog
AWS News Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
The Last Watchdog
The Last Watchdog
博客园 - 聂微东
T
Threat Research - Cisco Blogs
B
Blog
Attack and Defense Labs
Attack and Defense Labs
L
Lohrmann on Cybersecurity
C
CXSECURITY Database RSS Feed - CXSecurity.com
阮一峰的网络日志
阮一峰的网络日志
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
IT之家
IT之家
N
News and Events Feed by Topic
博客园 - 司徒正美
H
Help Net Security
C
Cisco Blogs
C
Check Point Blog
S
Secure Thoughts

The Will Will Web

解密 macOS 視窗管理:從視窗縮放到虛擬空間的核心邏輯 - The Will Will Web Azure OpenAI Service API 設計演進:從部署導向到統一 v1 介面 - The Will Will Web 如何使用 ssh-copy-id 快速設定 Linux 遠端主機的 SSH 免密碼登入 - The Will Will Web Windows 終端機入門操作手冊 - The Will Will Web 如何利用全新的 Trusted publishing 方法發佈 npm 套件 - The Will Will Web 如何正確對 WSL 2 的 ext4.vhdx 虛擬硬碟進行壓縮 - The Will Will Web 免費 GPU 就在 VS Code 裡 - Google Colab 官方擴充套件完整解析 - The Will Will Web 如何在 VS Code 搞定 .NET 主控台應用程式含執行參數的偵錯設定 - The Will Will Web 使用 Directory.Build.props 與 Directory.Build.targets 自動化 .NET 建置作業 - The Will Will Web uv 與 uvx 命令全攻略:Python 開發者的極速工具指南 - The Will Will Web 如何在 Ubuntu 22.04.5 LTS 更新 7-Zip 程式到最新版 - The Will Will Web 如何設定 Husky.Net 讓開發團隊確保一致的程式碼風格 - The Will Will Web 徹底重裝 Microsoft Teams 的方法 - The Will Will Web 如何透過批次檔批次將 PFX 憑證的私密金鑰匯出並重新打包新的 PFX 檔案 - The Will Will Web 開發 .NET 應用程式可利用 dotnet format 建立一致的程式碼風格 - The Will Will Web
如何在 Windows 安裝和設定 Cloudflare Tunnel 服務 - The Will Will Web
Will Huang · 2026-02-08 · via The Will Will Web

Cloudflare Tunnel 是 Cloudflare 提供的一種服務,允許你將本地服務安全地暴露給網際網路,而無需開放防火牆或設定路由器。我最近因為重新整理了一台測試機,整理了一些筆記,本篇文章我打算記錄如何在一台乾淨的 Windows Server 環境中安裝和設定 Cloudflare Tunnel 服務的過程。

Image

安裝 Cloudflare Tunnel

你必須先下載正確的 cloudflared 命令列工具。

透過 winget 的安裝命令如下:

winget install --id Cloudflare.cloudflared

請勿使用 chocolatey 安裝!

你也可以從 GitHub Release 下載最新版本回來安裝。

設定 Cloudflare Tunnel

請依照以下步驟設定即可:

  1. 登入 Cloudflare 帳號並產生 ~\.cloudflared\cert.pem 通道憑證 (Argo Tunnel Token)

    cloudflared tunnel login
    

    選擇 your-domain.com 域名

  2. 列出現有 Cloudflare 帳號下的通道

    建立 my-tunnel 通道 (建立過就不用再次建立)

    cloudflared tunnel create my-tunnel
    

    回傳內容:

    Tunnel credentials written to C:\Users\Administrator\.cloudflared\8f721c95-xxxx-xxxx-xxxx-90f59448c88e.json. cloudflared chose this file based on where your origin certificate was found. Keep this file secret. To revoke these credentials, delete the tunnel.
    
    Created tunnel my-tunnel with id 8f721c95-xxxx-xxxx-xxxx-90f59448c88e
    

    💡 這裡 8f721c95-xxxx-xxxx-xxxx-90f59448c88e 就是通道編號 (Tunnel-UUID)。

    列出通道資訊

    cloudflared tunnel list
    

    查詢通道資訊

    cloudflared tunnel info my-tunnel
    

    注意: 這裡 cloudflared tunnel list 會顯示你的通道編號 (Tunnel-UUID),這是跟著 Cloudflare 帳號 (Account) 走的,而不是跟著網域 (Domain) 走的。

  3. 用取得到的 Tunnel Token (Tunnel credentials) 建立 CNAME 域名

    cloudflared tunnel route dns 'my-tunnel' 'testing-5678.your-domain.com'
    
  4. 手動建立 ~/.cloudflared/config.yml 設定檔案

    tunnel: 8f721c95-xxxx-xxxx-xxxx-90f59448c88e
    
    ingress:
    
      - hostname: testing-5678.your-domain.com
        service: http://localhost
    
      - service: http_status:404
    

    注意: 這裡 8f721c95-xxxx-xxxx-xxxx-90f59448c88e 就是你的 Tunnel UUID,此值可從 cloudflared tunnel list 命令中獲取。

  5. 測試並執行

    確認設定無誤後,即可啟動 Tunnel:

    cloudflared tunnel run my-tunnel
    

這樣就完成了 Cloudflare Tunnel 的設定,現在你可以透過 testing-5678.your-domain.com 這個域名來訪問你本地的服務了。

相關連結