Caddy vs nginx: HTTPS, configuration and performance compared
The commands on this page have not been executed by our verification runner yet.updated 2026-10-20
- tool
- Caddy
- compares
- Caddy vs nginx
Caddy obtains and renews TLS certificates by itself and redirects HTTP to HTTPS by default, so a reverse proxy for one site is three lines. nginx does not manage certificates (you add certbot or another ACME client), but it has a larger ecosystem, more tuning options and more existing documentation. Pick Caddy for simple sites and small teams; pick nginx when you need its modules, fine-grained control, or the tooling around it.
The same reverse proxy
example.com {
reverse_proxy localhost:3000
}server {
listen 80;
server_name example.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
http2 on;
server_name example.com;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}Caddy's reverse_proxy sets the X-Forwarded-* headers itself.
Criterion by criterion
| Criterion | Caddy | nginx |
|---|---|---|
| HTTPS certificates | automatic (ACME), including renewal | external ACME client such as certbot |
| HTTP to HTTPS redirect | automatic | a server block with return 301 |
| Configuration | Caddyfile or JSON, with a live admin API | nginx.conf, reload with nginx -s reload |
| HTTP/3 | enabled by default | needs ngx_http_v3_module and listen … quic |
| Extending | Go plugins compiled in with xcaddy | C modules, njs, or OpenResty (Lua) |
| Written in | Go (memory-safe) | C |
| Ecosystem and examples | smaller | very large |
For most sites, either server's throughput is far higher than the application behind it; choose by operations and features, not benchmarks.
Sources
Related pages
errors · caddyCaddy: Caddyfile:2: unrecognized directiveCaddy fails with Caddyfile:N: unrecognized directive for a misspelled directive, a plugin missing from the binary, or a global option inside a site block.flags · caddycaddy fmt --overwrite and --diff: format a Caddyfilecaddy fmt prints a Caddyfile in canonical style with tabs; --overwrite rewrites the file in place, --diff shows the changes, and it exits non-zero if needed.cheat sheets · nginxnginx cheat sheet: commands, server blocks, locations and proxyingnginx cheat sheet: test and reload, logs, server blocks, location matching order, reverse proxy headers, HTTPS redirects, static files and caching headers.