Traefik or Caddy: choosing a reverse proxy for a small platform
Published 2026-11-06
What a reverse proxy has to do
A reverse proxy terminates TLS, routes each hostname to the right backend, and ideally handles compression, headers and redirects in one place. Both Traefik and Caddy do this well and both obtain and renew certificates automatically. The difference is where the routing knowledge lives.
Label-driven routing with Traefik
Traefik watches an orchestrator, such as Docker or Swarm, and builds its routes from labels attached to services. When you deploy a service with a router rule label, the route exists. When you remove the service, the route disappears. Nothing needs reloading and the routing definition travels with the service it describes.
This fits a cluster where services come and go and where the people deploying a service are the same ones who know its hostname. The cost is that routing is spread across many compose files, and a mistake in a label shows up as a missing route rather than as a configuration error.
File-driven routing with Caddy
Caddy reads a single readable file. A site block names a host and a target, and that is almost the whole syntax. For a handful of sites on one host this is hard to beat: the full routing picture fits on one screen, review is a diff, and the defaults are sensible, including automatic HTTPS.
The cost appears at scale or with dynamic services. Someone must edit the central file for each new site, and a bind-mounted file can serve stale content after replacement, so remember to restart rather than only reload when the mount changed.
How to choose
- Few static sites on one machine: Caddy, for its clarity.
- Many services created and removed by deploy tooling on a cluster: Traefik, for its dynamic discovery.
- Mixed estates: use each where it fits, but write down which host uses which, so nobody edits the wrong one.
- Whatever you pick, keep the proxy configuration in version control and test changes on a non-production hostname first.
Security notes
Expose only the proxy to the internet. Keep backends on a private network, and do not publish their ports on the host. Add an identity layer in front of internal or development hostnames. And monitor certificate expiry independently, because a silent renewal failure looks like an outage to every user at once.