Caddy vs Nginx comes down to one trade. Caddy gets certificates, renews them, redirects HTTP and configures modern TLS with no setup at all, in a config file a third the length. Nginx gives you a larger ecosystem, finer control, fail-fast behaviour under overload and more operational history, and since August 2025 it can also fetch its own ACME certificates through an official module. For a small team running a handful of sites or a SaaS that needs certificates for customer domains, pick Caddy. For high-traffic edges, teams with years of nginx config, or anything leaning on nginx-only modules, stay on nginx.
The rest of this guide is the detail behind that answer: what certificate automation looks like in each when certificate lifetimes keep shrinking, the same four setups written for both servers, how plugins and modules differ, what credible benchmarks actually say, and the operational gotchas that only show up in production.
Versions checked on December 2, 2026: Caddy 2.11.9 (released November 5, 2026, GitHub releases), nginx 1.31.10 mainline and 1.30.8 stable (both November 23, 2026, nginx.org), and nginx-acme 0.4.2 (GitHub releases).
Caddy vs Nginx at a glance
| Caddy 2.11 | nginx 1.30 / 1.31 | |
|---|---|---|
| Language | Go (memory-safe) | C |
| Licence | Apache 2.0 | BSD 2-clause |
| Automatic HTTPS | Default, no config | Opt-in via ngx_http_acme_module (separate package) |
| ACME challenges | HTTP-01, TLS-ALPN-01, DNS-01 (with DNS plugin) | HTTP-01, TLS-ALPN-01 (no DNS-01 documented) |
| Wildcard certificates | Yes, via DNS-01 plugin | Not via the ACME module; use certbot/lego/acme.sh |
| Certificates for unknown hostnames (on-demand) | Yes, with an ask endpoint |
No |
| HTTP/3 | On by default (h1 h2 h3) |
ngx_http_v3_module, documented as experimental |
| Config | Caddyfile, or native JSON | nginx.conf |
| Live reconfiguration | Admin REST API on localhost:2019 |
nginx -s reload (graceful worker replacement) |
| Extensions | Compiled in (xcaddy) | Dynamic modules (load_module), njs, many third-party |
| Built-in rate limiting | No (plugin) | Yes (limit_req, limit_conn) |
| Under overload (one benchmark) | Slows down | Refuses/drops connections |
Automatic HTTPS in the 47-day certificate world
This is the main reason people compare Caddy and nginx at all, and it matters more every year. Under CA/Browser Forum ballot SC-081v3, the maximum public certificate lifetime fell to 200 days on March 15, 2026, falls to 100 days on March 15, 2027 and reaches 47 days on March 15, 2029. Let's Encrypt is moving faster: its upcoming features page lists default certificates dropping to 64 days on February 10, 2027 and to 45 days on February 16, 2028. We cover the full timeline and a renewal checklist in 47-day TLS certificates: how to automate renewal. The short version: anything that renews on a fixed cron schedule, or needs a human, breaks first.
What Caddy does without being asked
Per the Automatic HTTPS docs, as soon as a site block names a public hostname, Caddy:
- obtains a certificate from Let's Encrypt, falling back to ZeroSSL if that fails, and retries with backoff if both fail;
- solves HTTP-01 or TLS-ALPN-01, and learns which one works on your network;
- redirects port 80 to 443;
- keeps the certificate renewed, honouring ACME Renewal Information (ARI) when the CA offers it. The global options page describes how ARI lets the issuer dictate the renewal window, with
renewal_window_ratioas the knob for CAs that don't; - serves
localhostand IP addresses from its own internal CA and tries to install that root in the system trust store. Tools with their own CA bundle will report unable to get local issuer certificate until you add that root.
Two features nginx does not have at all. On-demand TLS gets a certificate during the first TLS handshake for a hostname that isn't in the config, which is exactly what a SaaS with customer custom domains needs. You must protect it with an ask endpoint that returns 2xx only for domains you actually serve, or anyone pointing DNS at you can make you burn through CA rate limits. And ACME profiles: the tls directive's acme issuer accepts profile <name> (marked experimental in the tls docs), so you can opt into Let's Encrypt's shorter-lived profiles now and find out what breaks before the defaults change.
The catch is storage. Certificates and keys live in Caddy's data directory, which by default sits under $HOME. In a container, that directory must be a persistent volume. Lose it on every deploy and you re-issue certificates every deploy, which is the fastest way to hit Let's Encrypt rate limits.
What nginx can do now
nginx shipped ngx_http_acme_module in August 2025 (nginx-acme 0.1.1), written in Rust and distributed as the nginx-module-acme package from nginx.org's repositories since 1.29.1 (Linux packages page). It has matured quickly: 0.2.0 added TLS-ALPN-01 and external account binding, 0.3.0 added profile and preferred_chain, and 0.4.0 added ARI support, always on with compatible CAs.
Limits worth knowing before you plan around it:
- No DNS-01 in the documentation, so no wildcard certificates and no issuance for hosts that aren't reachable on port 80/443. Wildcards and regex
server_namevalues are explicitly not valid identifiers. - You need a
resolverdirective, a shared memory zone and astate_path(otherwise account keys and certificates do not survive a restart). - It is a dynamic module you install and load, not a default. Distro nginx builds may not ship it, and building it yourself needs Rust 1.85+ and libclang (README).
Before this module, the standard nginx pattern was certbot (or lego, or acme.sh) writing files to disk plus a reload hook. That still works and is still the only option for wildcards, but it is two moving parts where Caddy has one. If you also run nginx with post-quantum key exchange, the OpenSSL side is covered in post-quantum TLS on nginx with X25519MLKEM768.
Config side by side: four common setups
All Caddy snippets use Caddyfile syntax for 2.11; all nginx snippets target 1.30 stable. I could not run either server in this environment, so test with caddy validate --config Caddyfile and nginx -t before reloading.
1. Reverse proxy with automatic HTTPS
Caddy:
{
email ops@example.com
}
app.example.com {
encode zstd gzip
reverse_proxy 127.0.0.1:3000
}
That is the whole thing: certificate, renewal, HTTP-to-HTTPS redirect, HTTP/2 and HTTP/3, WebSocket upgrades, and X-Forwarded-For, X-Forwarded-Proto and X-Forwarded-Host set for you. The reverse_proxy docs note that incoming X-Forwarded-* headers are ignored by default to stop spoofing; if a CDN or load balancer sits in front, list its ranges in the trusted_proxies server option.
nginx with the ACME module:
load_module modules/ngx_http_acme_module.so; # main context, top of nginx.conf
http {
resolver 1.1.1.1 9.9.9.9 valid=300s;
acme_issuer letsencrypt {
uri https://acme-v02.api.letsencrypt.org/directory;
contact ops@example.com;
state_path /var/cache/nginx/acme-letsencrypt;
accept_terms_of_service;
}
acme_shared_zone zone=ngx_acme_shared:1M;
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
upstream app {
server 127.0.0.1:3000;
keepalive 32;
}
server {
listen 80;
server_name app.example.com;
location / { return 301 https://$host$request_uri; }
}
server {
listen 443 ssl;
http2 on;
server_name app.example.com;
acme_certificate letsencrypt;
ssl_certificate $acme_certificate;
ssl_certificate_key $acme_certificate_key;
ssl_certificate_cache max=2;
gzip on;
gzip_types text/css application/javascript application/json image/svg+xml;
location / {
proxy_pass http://app;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}
}
The official example answers everything on port 80 with return 404 and challenges still succeed, which means the module answers /.well-known/acme-challenge/ before your location handlers. I use a 301 there instead; check the error log after the first start to confirm issuance worked on your build. The map and Connection lines exist because nginx does not pass WebSocket upgrades or use upstream keepalive unless told to. Caddy does both by default. Note that Connection is set from the map, so keepalive and WebSockets coexist.
2. Static site with SPA fallback and cache headers
Caddy:
www.example.com {
root * /srv/www
encode zstd gzip
try_files {path} {path}/ /index.html
file_server
@static path *.css *.js *.woff2 *.png *.svg
header @static Cache-Control "public, max-age=31536000, immutable"
}
example.com {
redir https://www.example.com{uri} permanent
}
nginx:
server {
listen 443 ssl;
http2 on;
server_name www.example.com;
# acme_certificate / ssl_certificate lines as above
root /srv/www;
gzip_static on;
location / {
try_files $uri $uri/ /index.html;
}
location ~* \.(css|js|woff2|png|svg)$ {
add_header Cache-Control "public, max-age=31536000, immutable";
try_files $uri =404;
}
}
nginx wins on static file serving knobs: sendfile, open_file_cache, gzip_static for pre-compressed assets, aio and the slice module. Caddy's file_server has precompressed for serving .br, .zst and .gz siblings, and is plenty for most sites.
3. Security headers
Caddy:
app.example.com {
header {
Strict-Transport-Security "max-age=31536000; includeSubDomains"
X-Content-Type-Options "nosniff"
Referrer-Policy "strict-origin-when-cross-origin"
-Server
}
reverse_proxy 127.0.0.1:3000
}
nginx:
server {
# ...
add_header_inherit merge; # 1.29.3+, so present in 1.30 stable
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
server_tokens off;
location /downloads/ {
add_header Content-Disposition "attachment"; # without merge, this would drop the three above
}
}
This is the oldest nginx footgun. The headers module docs state that add_header directives are inherited only if the current level defines none. Add one header in a location and your HSTS silently disappears there. add_header_inherit merge (new in 1.29.3) finally fixes it, but only if you remember to set it. Also note always: without it nginx adds headers only to 2xx and 3xx responses, so your error pages ship without HSTS. Removing the Server header entirely needs the third-party headers-more module in open-source nginx; server_tokens off only hides the version.
4. Rate limiting
nginx has this built in and it is excellent:
http {
limit_req_zone $binary_remote_addr zone=api:10m rate=10r/s;
limit_req_status 429;
server {
location /api/ {
limit_req zone=api burst=20 nodelay;
proxy_pass http://app;
}
}
}
Caddy has no rate limiter in the standard build. The usual answer is mholt/caddy-ratelimit, written by Caddy's author but, as its README says, not an official Caddy organization repository. Build it in with xcaddy build --with github.com/mholt/caddy-ratelimit, then:
api.example.com {
rate_limit {
zone api {
match {
path /api/*
}
key {remote_host}
events 600
window 1m
}
}
reverse_proxy 127.0.0.1:8080
}
It returns 429 with a Retry-After header and can share state across instances through Caddy storage. It counts events in a sliding window rather than nginx's leaky bucket with burst, so translate limits carefully rather than copying numbers across.
Modules and plugins
The extension models are different enough to drive the decision on their own.
Caddy plugins are Go modules compiled into the binary. You build a custom binary with xcaddy build --with <module>, download one from the Caddy website's build page, or use caddy add-package, which the command-line docs mark as experimental. caddy list-modules shows what you have. The consequence: your distro's caddy package cannot do DNS-01 for Cloudflare or Route 53, because DNS providers are plugins. Every team that needs wildcards ends up maintaining a custom build pipeline (often a two-stage Dockerfile on the caddy:builder image), and every Caddy upgrade means rebuilding it.
nginx compiles core modules in and supports dynamic modules via load_module. nginx.org ships geoip, image-filter, njs (JavaScript), perl, xslt, otel and acme as separate packages. Third-party dynamic modules must be built against the exact nginx version you run, which is why many teams lean on OpenResty (nginx plus LuaJIT) or vendor builds instead. The breadth is unmatched: ModSecurity, headers-more, Brotli, GeoIP2, VTS, Lua, and years of examples for each.
Rough rule: if your plugin list for Caddy is just a DNS provider, the build overhead is small. If you need a WAF, Lua scripting or a niche auth scheme, nginx (or OpenResty) is the safer bet.
Performance: what credible sources show
There is no recent, independent, rigorous Caddy vs Nginx benchmark I would stake a decision on, and neither project publishes one that compares the two. The most-cited independent test is Tyler Langlois's "35 Million Hot Dogs" from September 2022, run on two c5.xlarge instances with k6, Caddy 2.5.2 and open-source nginx. His conclusions, in his words: "Caddy and optimized Nginx are going to serve you well" for ordinary traffic, "Caddy's default configuration is good", and under extreme load "Nginx will fail by refusing or dropping connections, Caddy will fail by slowing everything down." Optimized nginx led on proxy throughput and latency at high concurrency; Caddy led in several synthetic and small-file tests.
Treat that as directional. It is four years and many releases old for both servers, the author flags his own methodology caveats, and default upstream nginx runs one worker process (most distro packages set worker_processes auto).
What I take from it in practice:
- At the request rates most applications see, the backend is the bottleneck, not the proxy. Choose on operations, not throughput.
- The failure mode difference is real and matters. If you want overload to shed load fast so an upstream load balancer can route elsewhere, nginx's behaviour is easier to reason about. If you would rather queue, Caddy's is friendlier.
- Caddy is a garbage-collected Go program, and the benchmark author observed memory growth under reverse proxying that he could not fully diagnose. On a 512 MB VPS with thousands of idle WebSockets, measure your own workload before committing.
Operational concerns
Reloads. nginx -s reload starts new workers with the new config and lets old ones drain; it is battle-tested and atomic (a bad config fails nginx -t and the old one keeps running). Caddy's caddy reload posts the new config to the admin API on localhost:2019. The API is powerful (you can PATCH a single route), but by default Caddy force-closes WebSocket connections on reload unless you set stream_close_delay, and the shutdown grace_period has no limit by default. Lock down the admin endpoint if anything untrusted can reach localhost, or disable it with admin off.
Logs. Caddy writes structured JSON access logs; nginx writes text by default and needs a log_format with escape=json for structured output. Caddy's JSON is easier to ship to Loki or Elasticsearch, and the native config is JSON too, which pipes nicely through tools like our JSON formatter when you inspect caddy adapt output.
Load balancing and health checks. Both do round robin, least connections and hashing. Caddy has active health checks (health_uri) and passive ones (fail_duration) in the free build. Open-source nginx has only passive checks (max_fails, fail_timeout); active health_check is an NGINX Plus feature. Caddy also exposes upstream health at GET /reverse_proxy/upstreams.
Security record. Both are actively patched, and both shipped real fixes this autumn. nginx's October 14 and November 18, 2026 releases fixed a long list of CVEs, many in HTTP/2, HTTP/3 and stream modules (nginx.org news, CHANGES). Caddy 2.11.3 and 2.11.9 carried security fixes, mostly in the FastCGI transport. Memory safety is a genuine point for Caddy: a Go server does not get use-after-free bugs in its own code, a class that appears repeatedly in nginx's 2026 changelog. Whichever you run, subscribe to the release feed and patch within days.
Kubernetes. Neither server is the default answer for cluster ingress any more. If you are leaving ingress-nginx, read ingress-nginx to Gateway API migration before picking a replacement.
Hiring and familiarity. Almost every ops engineer can read nginx config. Caddyfile is easier to learn, but your on-call rotation's 3 a.m. muscle memory is probably nginx.
Which should you use?
| Situation | Pick | Why |
|---|---|---|
| A few apps on one VPS, small team | Caddy | Zero-config HTTPS, short config, fewer moving parts |
| SaaS with customer custom domains | Caddy | On-demand TLS with an ask endpoint; nginx has no equivalent |
| Homelab or internal tools with wildcard certs | Caddy + DNS plugin | DNS-01 built into the server |
| High-traffic edge, heavy static serving | nginx | Mature tuning knobs, fail-fast overload behaviour |
| Need WAF, Lua, or specific third-party modules | nginx / OpenResty | Ecosystem breadth |
| Large existing nginx estate | nginx + ACME module | Add automated certificates without a migration |
| You'd rather not run a server at all | Neither | A managed platform; see Render vs Fly.io vs Railway |
If you are migrating from nginx to Caddy, do it site by site: run Caddy on a different port behind your existing nginx, or move one hostname's DNS at a time, and keep the nginx config until each site has renewed at least once under Caddy.
Frequently Asked Questions
Is Caddy faster than Nginx?
Not in any way that should decide your choice. The best-known independent test (2022) found Caddy and tuned nginx both perform well at normal loads, with tuned nginx ahead on proxy throughput at very high concurrency and Caddy ahead in some small-file tests. Your application backend is almost always the bottleneck.
Can Nginx get Let's Encrypt certificates automatically now?
Yes. The official ngx_http_acme_module (package nginx-module-acme) obtains and renews certificates with HTTP-01 or TLS-ALPN-01, supports ARI and ACME profiles, and needs no certbot. It does not document DNS-01, so wildcards still need an external ACME client.
Is Caddy production ready?
Yes. It has been stable since the 2.0 rewrite in 2020, is memory-safe Go, and is widely used as a reverse proxy. The main production considerations are persisting its data directory, maintaining a custom build if you need plugins, and setting stream_close_delay if you proxy long-lived WebSockets.
Does Caddy support HTTP/3?
Yes, by default. The protocols server option defaults to h1 h2 h3, so Caddy serves HTTP/3 over QUIC on UDP 443 without extra config; just open UDP 443 in your firewall. nginx supports HTTP/3 through ngx_http_v3_module, which its docs still describe as experimental and which requires --with-http_v3_module.
Should I use Caddy or Nginx for Docker containers?
Caddy is simpler for a single host running a few containers, provided you mount /data as a volume so certificates persist. nginx is a better fit when you need rate limiting without a custom build or when your team already maintains nginx images.
Can I run Caddy and Nginx together?
Yes. A common pattern is Caddy on 80/443 for certificates and routing, proxying to nginx on a local port where you need nginx-specific modules. Just make sure only one of them owns ports 80 and 443.
Bottom Line
Caddy is the better default for most new deployments in 2026: certificate automation that already copes with shrinking lifetimes, ACME profiles, on-demand TLS, and configs short enough to review in one glance. nginx is still the better tool where you need its module ecosystem, built-in rate limiting, deep static-serving tuning or predictable fail-fast behaviour, and its new ACME module removes the strongest argument for switching away from it. If you are happy on nginx, add the ACME module and ARI-aware renewal before 2027's shorter lifetimes arrive. If you are starting fresh, start with Caddy.