NewCode CLOUD — 20% off your first month on all cloud VPSClaim

Caddy Server on Hong Kong VPS: Automatic HTTPS Reverse Proxy (2026)

· 1 min read

Caddy obtains and renews TLS certificates automatically, enables HTTP/2 and HTTP/3 by default, and uses a short, readable configuration file. On a Hong Kong VPS it replaces the Nginx plus Certbot combination for many setups with far less configuration.


Step 1: Install

apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | tee /etc/apt/sources.list.d/caddy-stable.list
apt update && apt install -y caddy

Step 2: Caddyfile

# /etc/caddy/Caddyfile
app.example.com {
    encode zstd gzip
    reverse_proxy 127.0.0.1:3000 {
        health_uri /health
        health_interval 10s
    }
    header {
        Strict-Transport-Security "max-age=31536000"
        X-Content-Type-Options nosniff
    }
    log { output file /var/log/caddy/app.log }
}

api.example.com {
    reverse_proxy 127.0.0.1:4000 127.0.0.1:4001 {
        lb_policy least_conn
    }
}

static.example.com {
    root * /var/www/static
    file_server
    header Cache-Control "public, max-age=31536000, immutable"
}

Step 3: Reload

caddy validate --config /etc/caddy/Caddyfile
systemctl reload caddy
journalctl -u caddy -f

Caddy vs Nginx

Factor Caddy Nginx
HTTPS certificates Automatic Certbot needed
HTTP/3 Default Needs build or config
Config size Very short Longer, more granular
Ecosystem and tuning Smaller Very large

Conclusion

Caddy on a Hong Kong VPS is an excellent default for small teams that want secure HTTPS without maintenance. Keep Nginx where you need its extensive module and tuning ecosystem.

Simplify HTTPS: Browse Server.HK Hong Kong VPS plans.

Related articles

More in VPS & ServersServer setup guides