Every containerized production stack hits the same crossroads right after you get your app and database running safely: what sits on ports 80 and 443 in front of them?
In production, reverse proxy outages rarely happen because a proxy “wasn’t fast enough.” They happen at 3:00 a.m. when a Certbot cron hook silently fails to reload NGINX, when an unbuffered nginx -s reload kills long-lived Server-Sent Events, or when someone copies a 90-line Traefik Docker label block and breaks routing across three containers.
The short verdict. NGINX is still the raw throughput king (17,743 req/s), Caddy is the operational sweet spot (13,358 req/s, 35.7 MiB active RAM, 13-line config with built-in auto-HTTPS), and Traefik wins when containers spin up and down dynamically via Docker labels — at the cost of 4.5× more RAM under load.

If you already locked down your database layer (see PostgreSQL in Docker for Production), choosing the right Docker reverse proxy is the next structural decision. Instead of repeating decade-old “NGINX uses 10 MB and is 30% faster” folklore, we built a reproducible container benchmark and measured all three head-to-head.
Architecture: Three Proxies, Three Complexity Budgets
Before looking at requests per second, look at what each proxy actually asks you to maintain for the exact same production baseline (HTTPS + gzip/zstd + security headers + upstream keep-alive):

| Dimension | Caddy 2 (2.11.9) |
NGINX (1.31.10) |
Traefik v3 (3.8.0) |
|---|---|---|---|
| Core Engine | Go (net/http + crypto/tls) |
C event loop (epoll + OpenSSL) |
Go (net/http + crypto/tls) |
| Config Footprint (Equivalent Setup) | 13 lines (Caddyfile) |
39 lines (nginx.conf) |
38 lines (traefik.yml + dynamic.yml) |
| Automatic HTTPS (Let’s Encrypt) | Built-in & default (ACME + OCSP) | Manual (Certbot sidecar + cron + reload) | Built-in (HTTP-01 / TLS-ALPN-01 / DNS-01) |
| HTTP/3 (QUIC) | Enabled by default | Manual quic listener + UDP config |
Opt-in http3 entrypoint flag |
| Dynamic Docker Discovery | Manual Caddyfile (or caddy-docker-proxy plugin) |
Requires external nginx-proxy / docker-gen |
Native (providers.docker labels) |
| Config Reload Mechanism | Atomic caddy reload via :2019 Admin API |
nginx -s reload (spawns new workers) |
Automatic file/socket watcher (watch: true) |
Notice the trap in the NGINX column: those 39 lines do not even include TLS certificate issuance or renewal. To match Caddy’s automatic HTTPS, NGINX needs an extra Certbot container, a shared ACME challenge volume, and a reload trigger.
Real Docker k6 Benchmark: Throughput, Cold TLS & RAM
To eliminate host port-forwarding overhead and get clean numbers, all three proxies ran sequentially inside the same isolated Docker bridge network (rp-bench-net, --cpus=2 --memory=512m) in front of an identical Node.js 24 HTTP/SSE upstream (--cpus=2 --memory=256m), driven from inside the same network by Grafana k6 v2.4.0 (see Grafana k6 vs. Apache JMeter for why k6 avoids generator bottlenecks).

| Benchmark Metric (2 vCPU / 512 MiB Cap) | Caddy 2.11.9 |
NGINX 1.31.10 |
Traefik 3.8.0 |
|---|---|---|---|
Idle Container RAM (docker stats) |
19.2 MiB | 40.0 MiB | 22.3 MiB |
| Active RAM Under 50-VU Load | 35.7 MiB | 50.6 MiB | 160.0 MiB |
| Warm HTTPS + gzip (50 VUs, 15s) | 13,358 req/s | 17,743 req/s | 14,646 req/s |
Warm Latency (med / p95) |
3.41 ms / 7.02 ms | 1.17 ms / 3.09 ms | 3.21 ms / 5.53 ms |
| Cold TLS Handshakes (25 VUs, no reuse) | 1,181 req/s | 1,681 req/s | 1,196 req/s |
Cold TLS Latency (med / p95) |
11.26 ms / 24.13 ms | 1.36 ms / 68.33 ms | 10.78 ms / 23.44 ms |
| Zero-Downtime Reload (20 VUs + 5s SSE) | 0 drops · 25/25 ticks | 0 drops · 25/25 ticks | 0 drops · 25/25 ticks |
Three real-world findings jump straight out of those numbers:
- The “NGINX uses 10 MB RAM” myth breaks on modern Docker hosts. Because
nginx:alpineenablesworker_processes autoby default, NGINX spawns one worker per visible CPU core. On a multi-core host, idle NGINX started at 40.0 MiB — 2× higher than Caddy (19.2 MiB) and Traefik (22.3 MiB). - Traefik’s RAM jumps 7× under real traffic. At idle, Traefik looks lean (22.3 MiB). Under 50 concurrent virtual users, its active footprint jumped to 160.0 MiB (4.5× Caddy’s 35.7 MiB). On a 4 GB cloud VM that is irrelevant; on a 512 MB–1 GB micro-VPS sharing space with Postgres and an app container, it matters.
- Cold TLS tail latency favors Go under burst. NGINX pushed the highest average cold-TLS rate (1,681 req/s), yet its
p95tail spiked to 68.33 ms when 25 VUs hammered fresh RSA-2048 handshakes simultaneously. Both Go proxies (Traefik 23.44 ms, Caddy 24.13 ms) kept tail latency nearly 2.8× tighter.
Zero-Downtime Config Reloads & SSE/WebSocket Traps
In Scenario C, we drove 20 VUs of continuous HTTPS traffic while holding open a 5-second Server-Sent Events (/stream, 25 ticks) connection, and triggered a live config swap (X-Proxy-Gen: v1 → v2) mid-stream:
- Caddy (
caddy reload): Swapped cleanly tov2, 0 failed HTTP requests, 25/25 SSE ticks delivered. Because Caddy validates the config over its local:2019Admin API before applying, a brokenCaddyfileis rejected atomically without touching live traffic. - NGINX (
nginx -s reload): Also delivered 0 failed requests and 25/25 SSE ticks — because old worker processes stay alive until their existing long-lived connections close.
- Traefik (
watch: true/ Docker socket): Updated dynamically tov2with 0 dropped requests and 25/25 SSE ticks without any reload command. Watch out for one edge case: on network filesystems or editors that use atomicrename()swaps, verifywatch: truedetects the inode change in your container mount.
Copy-Paste Production Configs Compared
Nothing explains the ergonomics gap faster than seeing the exact files side by side for the same production setup (HTTPS, zstd/gzip, HSTS + nosniff, and streaming-safe proxying):
1. Caddy (Caddyfile — 9 lines with Auto-HTTPS)
Replace :8443 + manual cert paths with your domain name and Caddy handles Let’s Encrypt, HTTP→HTTPS redirects, OCSP stapling, and HTTP/3 automatically:
api.example.com { encode zstd gzip
header { Strict-Transport-Security "max-age=31536000; includeSubDomains" X-Content-Type-Options "nosniff" }
reverse_proxy app:8080 { flush_interval -1 }}2. NGINX (nginx.conf — 39 lines, excluding Certbot)
Notice the required Connection "" header reset for upstream keepalive 64, always on add_header (otherwise NGINX drops security headers on 4xx/5xx responses), and proxy_buffering off for SSE:
worker_processes auto;events { worker_connections 4096; }
http { sendfile on; gzip on; gzip_types application/json text/plain text/css application/javascript;
upstream backend { server app:8080; keepalive 64; }
server { listen 443 ssl; http2 on; server_name api.example.com;
ssl_certificate /etc/letsencrypt/live/api.example.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/api.example.com/privkey.pem;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; add_header X-Content-Type-Options "nosniff" always;
location / { proxy_pass http://backend; proxy_http_version 1.1; proxy_set_header Connection ""; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto $scheme; proxy_buffering off; } }}3. Traefik v3 (compose.yaml Docker Labels)
Traefik shines when you never want to edit a central proxy file as new microservices join your compose.yaml:
services: app: image: my-api:latest labels: - "traefik.enable=true" - "traefik.http.routers.app.rule=Host(`api.example.com`)" - "traefik.http.routers.app.entrypoints=websecure" - "traefik.http.routers.app.tls.certresolver=letsencrypt" - "traefik.http.routers.app.middlewares=sec-headers,gzip-compress" - "traefik.http.services.app.loadbalancer.server.port=8080"4 Production Traps That Break After Launch
Benchmarks test happy-path JSON responses. Real outages happen on uploads, CDN headers, idle streams, and brute-force spikes:
| Production Trap | Caddy 2 | NGINX | Traefik v3 |
|---|---|---|---|
Large file uploads (413 error) |
Unlimited by default (cap with request_body) |
Defaults to 1 MB (client_max_body_size 1m) — breaks uploads silently |
Unlimited by default (buffering middleware optional) |
| Built-in Rate Limiting | Requires plugin (xcaddy + caddy-ratelimit) |
Built-in (limit_req_zone / limit_req) |
Built-in (rateLimit middleware) |
| Idle WebSocket / SSE timeout | No hard 60s cut unless configured | Drops idle streams after 60s (proxy_read_timeout) |
respondingTimeouts.idleTimeout (180s default) |
| Real Client IP behind Cloudflare | trusted_proxies cloudflare / CIDR block |
set_real_ip_from + real_ip_header CF-Connecting-IP |
entryPoints.websecure.forwardedHeaders.trustedIPs |
Two of these catch teams off guard every single week:
- The NGINX
1 MBupload cliff (413 Request Entity Too Large): Everything works in local tests with tiny JSON payloads. Ten minutes after launch, the first user uploads a 2 MB avatar or PDF and NGINX rejects it before your backend ever sees the request. Always setclient_max_body_size 25m;(or your app’s exact ceiling) explicitly innginx.conf. - Rate limiting without
xcaddy: This is Caddy’s main batteries-not-included trade-off. NGINX (limit_req_zone) and Traefik (rateLimitmiddleware) ship rate limiting out of the box; standard Caddy requires building a custom binary withxcaddyandcaddy-ratelimit(or placing Cloudflare / app-level rate limiting in front). If strict per-IP edge throttling in a stock Docker image is a hard requirement, NGINX or Traefik saves a custom Dockerfile.
What About Nginx Proxy Manager and Kubernetes Gateway API?
Two questions come up on almost every Caddy vs NGINX vs Traefik thread:

-
Caddy vs. Nginx Proxy Manager (NPM): NPM wraps NGINX + Certbot behind a friendly web dashboard. For a homelab or a team that prefers click-ops over Git commits, NPM is fast to set up. For production engineering teams, Caddy wins on reproducibility: a 10-line
Caddyfilelives in Git, passes PR review, and deploys identically across staging and production without SQLite state inside a GUI container. -
Moving from Docker Compose to k3s / Kubernetes? Make sure you do not confuse two different projects:
- NGINX itself (
nginx:alpinein Docker) is not deprecated — it remains actively maintained. - Kubernetes
ingress-nginx(kubernetes/ingress-nginx) is retired as of March 2026 (archived and read-only, with no further CVE patches).
If you plan to outgrow a single Docker host, do not invest in legacy
nginx.ingress.kubernetes.io/*annotations. Traefik v3 already implements Kubernetes Gateway API natively alongside Docker Compose, making it the smoothest transition path (see k3s vs. k0s vs. MicroK8s vs. RKE2 when picking your lightweight cluster). - NGINX itself (
30-Second Production Choice Checklist
- Choose Caddy if you run a single VPS or Docker Compose stack, want 10-line configs + automatic HTTPS + HTTP/3, and value 35.7 MiB active RAM with zero Certbot maintenance.
- Choose NGINX if you need maximum raw throughput (17.7k+ req/s on 2 vCPU), heavy static caching, custom Lua/WAF modules, or already run hardened NGINX CI pipelines.
- Choose Traefik if containers frequently spin up and down via Docker labels, you want built-in middleware chains and a routing dashboard, and 160 MiB active RAM fits comfortably in your host budget.






From the community
Discussion on Mastodon & Bluesky
Replies to this article from the open web, pulled in live. No ads, no tracking scripts.
Reply there — it shows up here automatically.