跳至內容

Caddy

本頁使用了標題或全文手工轉換
維基百科,自由的百科全書
Caddy
原作者Matthew Holt
首次發布2015年4月28日,​9年前​(2015-04-28
當前版本
  • 2.10.0(2025年4月18日;穩定版本)[1]
編輯維基數據鏈接
源代碼庫 編輯維基數據鏈接
編程語言Go
操作系統AndroidBSD variantsLinuxOS XWindows
類型Web服務器, 反向代理服務器
許可協議Apache許可證2.0
網站官方網站 在維基數據上編輯此內容

Caddy服務器(或稱Caddy Web)是一個開源的,使用Golang編寫,支持HTTP/2的Web服務端。它使用Golang標準庫提供HTTP功能。

Caddy一個顯著的特性是默認啟用HTTPS[2][3]。它是第一個無需額外配置即可提供HTTPS特性的Web服務器[4]

作者Matt Holt於2014年12月開始開發Caddy,並於2015年4月發布第一個版本。[5]在發布後的一年裡,它的下載量超過了20000次,並在GitHub上獲得了4500個Star。[6]

Caddy支持各種Web技術,提供靜態編譯的二進制文件,支持i386amd64ARM架構上的WindowsMacLinuxAndroidBSD操作系統。

功能

[編輯]

Caddy可以提供各種網站技術,它也可以作為反向代理和負載均衡器。Caddy的大部分功能都以中間件的形式實現,並通過Caddyfile中的指令(用於配置Caddy的文本文件)進行控制。[7]

安全

[編輯]

Caddy免於很多已知的CVEs攻擊(包括 Heartbleed、DROWN、POODLE和BEAST[12],另外,Caddy使用TLS_FALLBACK_SCSV以防止協議降級攻擊。

2015年6月2日,版本0.7.1修復了Caddy簡單服務器鑒權中間件中時間欺詐攻擊的漏洞。[13]

關於協議和密碼套件,Caddy使用TLS 1.0-1.2,並且傾向於ECDHE ECDSA與AES256-GCM-SHA384,支持十幾種不同的加密方式。Cloudflare已經使用了Caddy作為TLS 1.3的實現方案。[14]

傳統的特權降級無法工作在Golang程序上。[15] 為了綁定低於1024的端口,Caddy必須使用root賬戶運行 (不建議) 或通過setcap給予低位端口使用權限(建議的)。並且,在將來的版本中會嘗試使用非特級子進程運行。[16]

Caddy沒有自動啟動HTTP Strict Transport Security,推薦通過Caddy的header配置啟用HSTS。[17]

自動簽發 HTTPS

[編輯]

Caddy默認通過檢查域名來啟用HTTPS (通過ACME protocol檢查域名並簽發證書),並且重定向HTTP請求到HTTPS。[18] 它在啟動期間根據需要簽發證書,並在服務器的使用期間自動重簽發。Let's Encrypt是默認的證書頒發機構,但用戶可以自定義所使用的ACME CA,這在測試配置時是必要的。在2016年第一季度,有百分之二的Let's Encrypt證書是由Caddy簽發的。

一個可選的配置允許Caddy在需要時簽發一個證書「按需 TLS」[19]使用這種方案時,用戶必須指定可通過該方案配置的證書數量。當Caddy收到一個沒有配置證書的請求時,它會自動通過ACME簽發並配置,然後將證書存儲於內存和硬盤。這個過程通常需要幾秒鐘的時間,並且受到限制。

當使用TLS,Caddy會自動切換會話密鑰以保證安全性。[20]

參考資料

[編輯]
  1. ^ Release v2.10.0. 2025年4月18日 [2025年4月19日]. 
  2. ^ Johnson, Brad. A Better Web Server with Free SSL. 23 February 2016 [5 March 2016]. (原始內容存檔於2017-08-02). 
  3. ^ Automatic HTTPS with Caddy Server. 18 December 2015 [5 March 2016]. (原始內容存檔於2017-08-02). 
  4. ^ Dmitry Chestnykh [@dchest]. Caddy is the first general-purpose web server to default to HTTPS without user intervention (using Let's Encrypt) (推文). 17 December 2015 –透過Twitter. 
  5. ^ Show HN: Caddy, a cross-platform HTTP/2 web server. 28 April 2015 [2017-04-03]. (原始內容存檔於2017-04-22). 
  6. ^ Is Caddy Free?. [2017-04-03]. (原始內容存檔於2017-04-22). 
  7. ^ The Caddyfile. [29 February 2016]. (原始內容存檔於2017-04-20). 
  8. ^ tls - Caddy Directives. [8 March 2016]. (原始內容存檔於2017-03-17). 
  9. ^ Benedetti, Benoit. Caddy, Le Serveur Web Facile [Caddy, The Easy Web Server]. GNU/Linux Magazine France (France). November 2015 (法語). 
  10. ^ How to Setup the Caddy Web Server with php-fpm. [2017-04-03]. (原始內容存檔於2017-08-18). 
  11. ^ Beke, Mathias. Caddy Server and WordPress (PHP-FPM). 21 August 2015 [2017-04-03]. (原始內容存檔於2016-05-03). 
  12. ^ SSL Server Test: caddyserver.com (Powered by Qualys SSL Labs). [5 March 2016]. (原始內容存檔於2021-04-10). 
  13. ^ Release 0.7.1 · mholt/caddy. 2 June 2015 [2017-04-03]. (原始內容存檔於2019-02-15). 
  14. ^ Nick Sullivan [@grittygrease]. It's built in Go using custom versions @rlbarnes's Mint and @mholt6's Caddy (推文). 4 Mar 2016 –透過Twitter. 
  15. ^ syscall: Setuid/Setgid doesn't apply to all threads on Linux. 21 January 2011 [5 March 2016]. (原始內容存檔於2018-02-07). 
  16. ^ Implement privilege de-escalation. 21 January 2016 [2017-04-03]. (原始內容存檔於2017-04-22). 
  17. ^ HTTP Strict Transport Security. [8 March 2016]. (原始內容存檔於2017-04-26). 
  18. ^ Automatic HTTPS. [5 March 2016]. (原始內容存檔於2017-03-17). 
  19. ^ On-Demand TLS. [5 March 2016]. (原始內容存檔於2017-03-17). 
  20. ^ Springall, Drew; Durumeric, Zakir; Halderman, J. Alex. Measuring the Security Harm of TLS Crypto Shortcuts. Proceedings of the 2016 ACM on Internet Measurement Conference. IMC '16 (New York, NY, USA: ACM). 2016-01-01: 33–47. ISBN 9781450345262. doi:10.1145/2987443.2987480. 

外部連結

[編輯]