TExcelTAD

Choosing Between the Four

All four servers in this course can put an application behind HTTPS with load balancing. The real differences are in what each does best, how you change it while it runs, and where it fits in your platform. This lesson puts them side by side, then adds the options outside this course you will meet in the same decision.

Side by side

Nginx HAProxy Caddy Traefik
Core strength web server + proxy + cache load balancing, traffic control automatic HTTPS, simplicity dynamic routing from providers
Static files excellent no good no
Caching full proxy cache small object cache via plugin via plugin
Active health checks NGINX Plus only yes, rich yes yes
Load-balancing methods RR, least_conn, hash, ip_hash, random the most: + first, uri, hdr, queues with maxconn RR, least_conn, random, hashes, … weighted RR (newer 3.x releases add more strategies)
Rate limiting limit_req / limit_conn stick tables (most flexible) via plugin rateLimit / inFlightReq middlewares
TLS certificates external (certbot, cert-manager) external (+ runtime hot swap) automatic ACME, internal CA, on-demand automatic ACME
Changing config live reload (graceful) reload + Runtime API JSON admin API providers (no reload at all)
Metrics stub_status + exporter built-in Prometheus built-in built-in
HTTP/3 1.25+ (not Ubuntu 24.04's 1.24) 2.6+ (2.8 here, with limited-quic) on by default opt-in per entry point
Kubernetes NGINX Gateway Fabric; ingress-nginx is retired HAProxy Kubernetes Ingress Controller community ingress Ingress + Gateway API + CRDs (k3s default)

Typical choices

  • A single VM or a small fleet serving a web app with static assets: Nginx or Caddy. Caddy if you want HTTPS with no moving parts; Nginx if you need its cache, its huge body of examples, or your team already knows it.
  • A load-balancing tier in front of many app servers (VMs, bare metal), with health checks, queues, connection limits, draining for deploys and fine-grained traffic rules: HAProxy.
  • Containers on Docker hosts or Kubernetes, where services appear and disappear: Traefik (or another Gateway API controller), configured by labels or resources next to each service.
  • Multi-tenant SaaS with customer domains: Caddy's on-demand TLS.
  • Edge plus internal: it is common to combine them: a cloud load balancer or HAProxy at the edge, Nginx next to each app for static files and caching, or Traefik as the cluster's Gateway behind a cloud load balancer.

Here is that reasoning as a small function, applied to a few situations:

python · try it yourself
def recommend(needs):
    """Return (choice, reason) for a set of needs. A sketch of the reasoning, not a law."""
    if "kubernetes" in needs or "docker-labels" in needs:
        return "Traefik (or another Gateway API controller)", "routes come from the platform, no reloads"
    if "customer-domains" in needs:
        return "Caddy", "on-demand TLS with an ask endpoint"
    if {"queues", "draining"} & needs or "many-backends" in needs:
        return "HAProxy", "health checks, maxconn queues, Runtime API"
    if "cache" in needs or "static-files" in needs:
        return "Nginx", "static files and a full proxy cache"
    return "Caddy", "automatic HTTPS with the least configuration"

scenarios = {
    "blog on one VM":                     {"static-files", "https"},
    "API fleet of 40 VMs":                {"many-backends", "draining", "https"},
    "SaaS storefronts":                   {"customer-domains", "https"},
    "microservices on k8s":               {"kubernetes", "https"},
    "product catalogue with heavy reads": {"cache", "https"},
    "internal admin tool":                {"https"},
}
for name, needs in scenarios.items():
    choice, why = recommend(needs)
    print(f"{name:36} -> {choice}: {why}")
blog on one VM                       -> Nginx: static files and a full proxy cache
API fleet of 40 VMs                  -> HAProxy: health checks, maxconn queues, Runtime API
SaaS storefronts                     -> Caddy: on-demand TLS with an ask endpoint
microservices on k8s                 -> Traefik (or another Gateway API controller): routes come from the platform, no reloads
product catalogue with heavy reads   -> Nginx: static files and a full proxy cache
internal admin tool                  -> Caddy: automatic HTTPS with the least configuration

What else you will meet

Option What it is When
Envoy a proxy configured entirely through APIs (xDS); the data plane of Istio, Envoy Gateway and many API gateways service meshes, Gateway API, very dynamic environments; rarely configured by hand
Cloud load balancers (AWS ALB/NLB, Azure Application Gateway, Google Cloud Load Balancing) managed L4/L7 balancing with certificates and WAF options the public edge in the cloud; often in front of one of the four (AWS)
CDNs (CloudFront, Cloudflare, Fastly, Akamai) caching and TLS at hundreds of locations static assets, global latency, DDoS absorption (CDNs)
NGINX Plus, HAProxy Enterprise, Traefik Hub commercial editions active health checks and dynamic upstreams (Plus), WAF and support
Apache httpd the classic web server existing PHP/CGI estates, .htaccess-based hosting

About ingress-nginx

The Kubernetes community's ingress-nginx controller (not the same as NGINX Inc.'s products) was retired: its maintainers announced in November 2025 that maintenance would end in March 2026. Existing clusters should plan a migration, ideally to the Gateway API with a maintained controller (Traefik, Envoy Gateway, NGINX Gateway Fabric, HAProxy, Cilium, Istio and others), as described in Gateway API. Nginx itself, as a web server and proxy, is of course alive and well.

Test yourself

Which server's live configuration changes come from providers such as Docker labels or Kubernetes resources, with no reloads?

  1. Nginx
  2. HAProxy
  3. Caddy
  4. Traefik

Which feature is missing from open-source Nginx but built into the other three?

  1. TLS
  2. Active health checks
  3. Load balancing
  4. HTTP/2

A cluster still runs the community ingress-nginx controller. What is the recommended direction?

  1. Nothing, it is maintained
  2. Migrate, preferably to the Gateway API with a maintained controller, because ingress-nginx was retired in 2026
  3. Replace Kubernetes
  4. Switch to Apache