
Caddy Has a Free API: The Web Server With Automatic HTTPS
Nginx needs 15 lines of config for HTTPS. Caddy needs 2. And it handles certificate renewal automatically. What Is Caddy? Caddy is a modern web server with automatic HTTPS. It obtains and renews TLS certificates from Let's Encrypt without any configuration. # Caddyfile — that's the ENTIRE config mysite.com { reverse_proxy localhost: 3000 } caddy run # HTTPS certificate obtained and configured automatically Reverse Proxy # Multiple backends api.example.com { reverse_proxy localhost: 8080 } app.example.com { reverse_proxy localhost: 3000 } # Load balancing api.example.com { reverse_proxy localhost: 8080 localhost: 8081 localhost: 8082 { lb_policy round_robin health_uri / health health_interval 10s } } Static Files + SPA mysite.com { root * / var / www / html file_server try_files { path } / index.html # SPA fallback encode gzip } The Admin API Caddy has a REST API for dynamic configuration: # Get current config curl localhost:2019/config/ # Add a route dynamically curl -X POST localhost:
Continue reading on Dev.to DevOps
Opens in a new tab



