Web browser or API consumer
Backend & Runtime / Knowledge library
Caddy
automatic https static files and proxy routing
Why learn Caddy?
Useful for serving applications with compact configuration. Certificate automation still depends on correct domain, network, and issuer conditions.
Where it came from
Caddy is an extensible web server and proxy written in Go. Its documentation covers static serving, reverse proxying, dynamic configuration, and automatic HTTPS.
Build your understanding
Work through these exercises in order. Try the task before opening a reference.
- Serve a local static directory.
- Proxy a request to a local backend.
- Validate a Caddyfile before loading it.
- Inspect access logs for a failed upstream.
- Explain the prerequisites for automatic certificate issuance.
Documentation and sources
- Official project documentation (caddyserver.com)
Catalog research notes
- Research snapshot: September 9, 2026. This entry summarizes the linked primary documentation; it does not assert a latest release version.
Connect the ideas
Alternatives
Explore next
Real World Example
Automated Secure Proxy for Micro-SaaS
A boutique micro-SaaS provider managing multiple independent web applications and internal microservices.
The business problem
Manual certificate management and complex Nginx configurations lead to frequent downtime during certificate renewals and routing errors when scaling services.
How this topic solves it
Caddy automates HTTPS certificate provisioning via ACME protocol and simplifies routing through a declarative Caddyfile, allowing the provider to serve static assets and proxy traffic to backend services with minimal overhead.
- Install the Caddy binary on the host server.
- Define the domain names in the Caddyfile to trigger automatic TLS.
- Use the file_server directive to serve static frontend assets.
- Configure the reverse_proxy directive to route API traffic to internal ports.
- Reload the configuration using the Caddy API or system service restart.
Shows how Caddy acts as the central gateway for incoming requests.
Reverse proxy and TLS terminator
Local disk storage
Internal microservice
- Client → HTTPS Request → Caddy
- Caddy → Serve static content → Static Files
- Caddy → Reverse proxy API call → Backend Service
Implementation example
This Caddyfile maps the root path to static files and routes all /api paths to a local backend service, while Caddy automatically handles the TLS certificate for example.com.
example.com {
root * /var/www/html # Serve static files
file_server
reverse_proxy /api/* localhost:8080 # Proxy API requests
}Expected business outcome
The provider achieves zero-touch SSL management and a human-readable configuration format that reduces the risk of manual routing errors.
Limitations and checks
Caddy performs automatic certificate management which requires port 80/443 access; if the server is behind a restrictive firewall or lacks public DNS resolution, the ACME challenge will fail, requiring manual certificate handling.