Deployment guide

Caddy vs Nginx: Which Web Server / Reverse Proxy for Your VPS?

Deploy on a VPS Cloud →

Comparison7 min read

Caddy vs Nginx: Which Web Server / Reverse Proxy for Your VPS?

Any VPS that serves HTTP needs a web server or a reverse proxy at the front. Caddy automates HTTPS and is configured in a few lines; Nginx dominates through its maturity and fine-tuning. Here's how to decide.

Why Take Care of Your Reverse Proxy on a VPS

On a VPS, the front-end web server is the piece that orchestrates everything: it terminates TLS, distributes traffic to your containers (app, forge, media server, LLM), serves static files, and applies security headers. Well chosen, it radically simplifies enabling HTTPS on all your subdomains. Caddy obtains and renews Let's Encrypt certificates automatically, with no configuration, using a readable Caddyfile of a few lines. Nginx, the industry reference, offers extremely fine control (cache, rewrite rules, load balancing, rate limiting) but requires manual certificate management or management via Certbot. The choice pits modern automation against proven, total control.

What a Good Front End Brings to Your VPS

  • Centralized TLS termination for all your subdomains
  • A single reverse proxy to multiple Docker containers
  • Fast static file serving and compression (gzip/brotli)
  • Security headers (HSTS, CSP) applied in the same place
  • With Caddy: Let's Encrypt certificates obtained and renewed all on their own
  • With Nginx: cache, rate limiting, and load balancing finely tuned

Prerequisites: A Frugal Front End

A reverse proxy is very lightweight: both Caddy and Nginx run comfortably on 1 vCPU and 512 MB to 1 GB of RAM, even in front of several services. The resource to watch is rather the bandwidth and the number of simultaneous connections. You'll need a domain and its subdomains pointing to the VPS IP (A/AAAA records), ports 80 and 443 open on the firewall (port 80 is required for certificate validation), and Docker if you containerize the proxy. No GPU or large storage: here, it's the configuration that makes the difference, not raw power.

Set Up Caddy (or Nginx) as a Reverse Proxy

01

Point the DNS

Create the A records (and AAAA if IPv6) for each subdomain (app, git, media) pointing to the VPS IP. Let's Encrypt validation will fail as long as DNS resolution isn't effective, so verify it first.

02

Open Ports 80 and 443

Allow only 80 and 443 on the firewall. Port 80 remains essential for the Let's Encrypt HTTP challenge and to automatically redirect traffic to HTTPS.

03

Write the Configuration

With Caddy, one block is enough: app.yourdomain.com { reverse_proxy 127.0.0.1:3000 } and HTTPS is automatic. With Nginx, write one server block per subdomain with proxy_pass and the X-Forwarded-* headers, then obtain the certificate via Certbot.

04

Launch and Reload Without Downtime

Start the service (docker compose up -d or systemd). After each change, validate the config (nginx -t or caddy validate), then hot-reload (nginx -s reload / caddy reload) to never interrupt traffic.

05

Harden Security

Enable HSTS, hide the server version, enforce TLS 1.2+, and add basic rate limiting. Centralize these headers at the proxy level so that they apply to all downstream services.

06

Set Up Logs and Monitoring

Enable access and error logs, and watch for 502/504 codes that reveal an unreachable downstream container. A healthy front end with 502 errors always points to the proxied service, not to the proxy.

CriterionCaddyNginx
HTTPS / certificatesAutomatic, zero configManual or via Certbot
Configuration syntaxCaddyfile, very conciseMore verbose, very expressive
Learning curveLowModerate to high
Fine-grained control (cache, rewrite, LB)Good, sometimes via pluginsVery complete and proven
Static performanceExcellentExcellent, the reference
HTTP/3 / QUICEnabled by defaultSupported depending on version
Ecosystem / documentationRecent, growingVast, very mature
Ideal forQuick HTTPS setup, multi-subdomainAdvanced tuning, high traffic

If you're hesitating, know that they're not mutually exclusive: a common pattern places Caddy as the very first front end to automatically manage TLS for all your subdomains, then leaves Nginx downstream for fine caching and rewrite rules of a specific service. This way you combine automatic certificates with tuning control, without picking a side for good.

An HTTPS Front End Ready in a Few Lines

The ServOrbit Cloud VPS with a Docker template lets you deploy Caddy or Nginx as a reverse proxy, with automatic SSL for all your subdomains and services.

Need help?

Browse our help center and FAQ, or write to our team — support in French, English and Arabic.