Caddy vs Nginx for Automatic TLS
Bottom line: Caddy gets a valid certificate with three lines of config and renews it forever; Nginx needs certbot, a renewal hook, a reload path and a monitoring check. Nginx wins on throughput and ecosystem breadth. For a personal site, the operational difference dominates.
The two configurations
Caddy:
1 | example.com { |
Nginx, plus certbot, plus a systemd timer, plus a deploy hook, plus proxy_pass care:
1 | server { |
Caddy does ACME, HTTP-01/TLS-ALPN, renewal at 2/3 of lifetime, OCSP stapling, HTTP/3 and sane cipher defaults without any of it being written down.
Where Nginx still wins
| Need | Winner |
|---|---|
| Raw request throughput | Nginx (~1.4×) |
| Third-party modules (ModSecurity, GeoIP) | Nginx |
| Existing team familiarity | Nginx |
| Per-location rate limiting | Nginx |
| Configuring from zero | Caddy |
Throughput at these scales rarely decides: both serve thousands of req/s on a $5 VPS and the application is the bottleneck.
Renewal failure modes
Certbot’s renewal succeeds but the running server keeps the old certificate in memory until reloaded. A missing --deploy-hook "systemctl reload nginx" means a green renew log and an expired certificate served 90 days later.
1 | # the hook that is usually missing |
Caddy reloads itself. There is no equivalent gap.
Verification either way
1 | echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null \ |
The notAfter value is the only certificate fact that matters. Check it monthly regardless of what the ACME client claims — and alert at 20 days remaining.
Choosing
Personal site, homelab, small service: Caddy, and stop thinking about certificates. Anything needing WAF rules, complex rewrite chains or a module ecosystem: Nginx with certbot and the deploy hook. Running both is also legitimate — Caddy in front for TLS, Nginx behind for the rules.
Operating notes
Personal site, homelab, small service: Caddy. Stop thinking about certificates — it does ACME, renewal at two-thirds lifetime and HTTP/3 with no config text.
1 | example.com { root * /var/www file_server } |
If you stay on Nginx
The missing piece is almost always the deploy hook. Renewal succeeds, the running server keeps the old certificate in memory, and the log is green for 90 days.
1 | certbot renew --deploy-hook "systemctl reload nginx" |
Verify either way
1 | echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null | openssl x509 -noout -dates |
notAfter is the only certificate fact that matters. Alert at 20 days remaining regardless of what the ACME client reports.
Both is legitimate
Caddy in front for TLS, Nginx behind for WAF rules and rewrite chains. The split puts each tool where it is strongest.
FAQ
Why does Nginx serve an expired certificate even though certbot renewal succeeded?
Certbot renews the certificate files on disk, but the running Nginx process keeps the old certificate in memory until it is reloaded. Without a deploy hook that reloads Nginx, renewal logs stay green while an expired certificate is served 90 days later. Adding --deploy-hook "systemctl reload nginx" to the renew command closes that gap.
How do I check which certificate my server is actually serving?
Use openssl s_client against your domain on port 443 with the servername flag, piped into openssl x509 -noout -dates. The notAfter value is the only certificate fact that matters. Check it monthly regardless of what the ACME client claims, and alert at 20 days remaining.
Does Caddy renew certificates automatically?
Yes. Caddy handles ACME, renewal at two-thirds of the certificate lifetime, OCSP stapling, HTTP/3 and sane cipher defaults without any of it being written in the config. It reloads itself after renewal, so there is no equivalent to Nginx’s missing-reload gap.
When should I choose Nginx over Caddy?
Choose Nginx when you need raw request throughput (roughly 1.4×), third-party modules like ModSecurity or GeoIP, per-location rate limiting, or existing team familiarity. Anything needing WAF rules, complex rewrite chains or a module ecosystem belongs on Nginx with certbot and the deploy hook.
Can I run Caddy and Nginx together?
Yes. A legitimate split is Caddy in front for TLS and Nginx behind for WAF rules and rewrite chains. This puts each tool where it is strongest, with Caddy handling certificates and Nginx handling the rule-heavy work.






