Caddy (web server)

From Infogalactic: the planetary knowledge core
Jump to: navigation, search
Caddy
The Caddy web server logo.svg
Original author(s) Matthew Holt
Initial release 28 April 2015; 8 years ago (2015-04-28)
Development status Active
Written in Go[1]
Operating system Android, BSD variants, Linux, OS X and Windows
Type Web server, reverse proxy server
License Apache 2
Website https://caddyserver.com

Caddy, sometimes clarified as the Caddy web server, is an open source, HTTP/2-enabled web server written in Go. It uses the Go standard library for its HTTP functionality.[1]

One of Caddy's most notable features is enabling HTTPS by default.[2][3][4] It is the first general-purpose web server to do so without requiring extra configuration.[5]

The author, Matt Holt, began developing Caddy in December 2014 and released it in April of 2015.[6] In the year following its release, it was downloaded over 20,000 times and received 4,500 stars on GitHub.[7]

Caddy supports a variety of Web technologies and is available as statically-compiled binaries for Windows, Mac, Linux, Android, and BSD operating systems on i386, amd64, and ARM architectures.

Capabilities

A variety of web site technologies can be served by Caddy, which can also act as a reverse proxy and load balancer. Most of Caddy's features are implemented as middleware and exposed through directives in the Caddyfile (a text file used to configure Caddy).[8]

  • HTTP/1.1 (plaintext HTTP) and HTTP/2 (default for HTTPS connections)
  • HTTPS, either automatically enabled and managed, or manually configured
  • Virtual hosting (multiple sites on the same port)[10]
  • Native IPv4 and IPv6 support
  • Serve static files (uses sendfile where possible)
  • Graceful restart/reload
  • Reverse proxy (HTTP or WebSockets)
  • Load balancing with health checks
  • FastCGI proxy[11][12]
  • Templates (similar to Server Side Includes)
  • Markdown rendering
  • CGI via WebSockets
  • Gzip compression
  • Basic access authentication
  • URL rewriting
  • Redirects
  • File browsing
  • Access, error, and process logs

Security

Caddy is not vulnerable to a number of widespread CVEs including Heartbleed, DROWN, POODLE, and BEAST.[13] In addition, Caddy uses TLS_FALLBACK_SCSV to prevent protocol downgrade attacks.

On June 2, 2015, version 0.7.1 was released to patch a vulnerability to timing attacks in Caddy's basic authentication middleware.[14]

With regards to protocols and cipher suites, Caddy uses TLS 1.0-1.2 and prefers ECDHE ECDSA with AES256 GCM SHA384, although a dozen different ciphers are supported. Caddy has also been used by Cloudflare as a platform to serve an experimental TLS 1.3 implementation.[15]

Traditional privilege de-escalation as performed in C programs is non-trivial in Go programs.[16] In order to bind ports lower than 1024, Caddy must be run as root (not recommended) or given capabilities to bind to low ports using setcap (recommended). However, an alternate method of dropping privileges that involves spawning an unprivileged child process will likely be implemented in a future version.[17]

Caddy does not automatically enable HTTP Strict Transport Security; it is recommended that users enable HSTS using Caddy's header directive.[18]

Automatic HTTPS

Caddy activates HTTPS by default for sites with qualifying domain names (names for which a TLS certificate can be negotiated via the ACME protocol), and redirects HTTP requests to HTTPS.[19] It obtains certificates as needed during startup and keeps them renewed during the lifetime of the server. Let's Encrypt is the default certificate authority, but the user may customize the ACME CA that is used, which is often necessary when testing configurations. As of Q1 2016, Caddy accounted for about 2% of certificates issued by Let's Encrypt.[20]

An alternate configuration allows Caddy to obtain certificates only as needed during TLS handshakes rather than at startup, a feature dubbed "On-Demand TLS."[21] To enable this feature, the user must specify a maximum number of certificates that can be issued this way. When Caddy receives a request for a hostname for which it does not yet have a certificate, it will negotiate a new certificate via ACME and serve it immediately, while caching the obtained certificate in memory and storing it on disk. This process usually takes a few seconds, and is subject to tight rate limits.[21]

References

  1. 1.0 1.1 Lua error in package.lua at line 80: module 'strict' not found.
  2. Lua error in package.lua at line 80: module 'strict' not found.
  3. Lua error in package.lua at line 80: module 'strict' not found.
  4. Lua error in package.lua at line 80: module 'strict' not found.
  5. Lua error in package.lua at line 80: module 'strict' not found.
  6. Lua error in package.lua at line 80: module 'strict' not found.
  7. Is Caddy Free?
  8. Lua error in package.lua at line 80: module 'strict' not found.
  9. Lua error in package.lua at line 80: module 'strict' not found.
  10. Lua error in package.lua at line 80: module 'strict' not found.
  11. Lua error in package.lua at line 80: module 'strict' not found.
  12. Lua error in package.lua at line 80: module 'strict' not found.
  13. Lua error in package.lua at line 80: module 'strict' not found.
  14. Lua error in package.lua at line 80: module 'strict' not found.
  15. Lua error in package.lua at line 80: module 'strict' not found.
  16. Lua error in package.lua at line 80: module 'strict' not found.
  17. Lua error in package.lua at line 80: module 'strict' not found.
  18. Lua error in package.lua at line 80: module 'strict' not found.
  19. Lua error in package.lua at line 80: module 'strict' not found.
  20. Lua error in package.lua at line 80: module 'strict' not found.
  21. 21.0 21.1 Lua error in package.lua at line 80: module 'strict' not found.