What it does
Caddy is a web server and reverse proxy with a human-readable Caddyfile and a JSON configuration API. It can manage certificate issuance and renewal for eligible public domains.
Why it’s interesting
Automatic certificate management removes a common operational burden. Dynamic configuration and module interfaces are also useful to study.
Real-world use case
Put a local app behind a reverse proxy, then use a real domain for automatic public TLS.
What I can learn
- 01
ACME certificate lifecycle
Follow ACME challenge, certificate storage, renewal, and serving steps that make HTTPS management automatic.
- 02
Hot configuration through an API
See how structured configuration can be applied while the server runs, allowing routes to change without dropping service.
- 03
Composable HTTP middleware and proxy modules
Explore how handlers and reverse-proxy modules compose into a request pipeline with reusable behavior.
One thing to explore
Reverse proxy and Caddyfile parser
Follow the modules/caddyhttp/reverseproxy implementation and connect it to the concepts above.
Explore the source (opens in a new tab)10-Minute Challenge
Proxy a local service
Before you start: Caddy and a local HTTP service listening on port 3000. Local addresses do not receive publicly trusted TLS certificates.
- Install Caddy using the official guide.
- Start a local app on port 3000.
- Run the reverse proxy command below and request port 8080.
caddy reverse-proxy --from :8080 --to :3000