Skip to content

The Neighbours

Traefik is one answer to the front-door question, not the only one, and not always the best one. The honest comparisons:

Nginx

The incumbent: a superb web server that also reverse-proxies, configured in files, reloaded by signal. Choose Nginx when you also need to serve files and apps from the same program, when your setup is static enough that watching containers buys nothing, or when you already know it — its configuration model is thirty years of convention and every hosting panel on earth speaks it. Traefik's edge is discovery: services that arrive and leave describe themselves, and Nginx learns about them when you edit and reload. For a stable handful of sites, that difference is smaller than enthusiasts on either side claim.

Caddy

The other modern answer, and Traefik's closest rival in spirit: one small binary, a terse configuration file, and HTTPS automation turned on by default rather than configured — including for names and setups Traefik handles too, which keeps the comparison honest. Choose Caddy when the shape is "a few sites, I want certificates to simply happen, and I want to think about the proxy least". Choose Traefik when the services multiply, move, live in Docker or Kubernetes, or when the dashboard and API earn their place. Many readers will be well served by either; the deciding factor is usually where the backends live, not the proxy's feature list.

HAProxy

Older, sterner, and unmatched at the load-balancing end of the job: health checks, queueing, and traffic behaviour of a depth Traefik doesn't attempt. Choose HAProxy when the proxying is the product — high-traffic TCP and HTTP balancing where its decades of tuning show. For a household's HTTPS front door it is a racing engine in a shopping trolley: magnificent, and the maintenance is yours.

Apache httpd

Still everywhere, and its mod_proxy does the routing in this guide's early chapters adequately within the server many sites already run. Choose it when Apache is already the web server and the proxying is a side duty; the cost is that discovery, dashboards and dynamic reload are not its world at all.

Cloud load balancers

AWS ALB, Google Cloud Load Balancing and their kin rent you the front door: routing rules, certificates and health checks as a managed service, billed monthly, scaling without your involvement. Choose them when the backends are already in that cloud and uptime is a contractual matter. At home and on a single VPS they solve a problem you don't have, at a price you do, while teaching nothing transferable — a judgement this guide makes about many managed things, and the reason the whole series runs its own.

Kubernetes ingress and Gateway API

In Kubernetes, Traefik is one of several ingress controllers, alongside the cloud vendors' and the Nginx project's; the Gateway API is the standard succeeding plain Ingress. This guide does not pretend to Kubernetes competence: the moving parts of chapter 2 map onto it, and the provider is documented, but nothing here was run on a cluster, and chapter 14 keeps it on the documented- only side of the ledger.