Back to articles
Caddy Has a Free Web Server That Auto-Configures HTTPS — Replace Nginx + Certbot With 3 Lines
How-ToDevOps

Caddy Has a Free Web Server That Auto-Configures HTTPS — Replace Nginx + Certbot With 3 Lines

via Dev.to DevOpsAlex Spinov

The HTTPS Problem Setting up HTTPS with Nginx: Install Nginx Install Certbot Run Certbot to get Let's Encrypt certificate Configure Nginx with SSL paths Set up cron job for certificate renewal Handle redirect from HTTP to HTTPS Caddy does all of this automatically. Point it at a domain, it handles the rest. What Caddy Gives You Automatic HTTPS # Caddyfile — that's the ENTIRE config example . com { reverse_proxy localhost : 3000 } Caddy automatically: Gets a Let's Encrypt certificate Redirects HTTP → HTTPS Renews certificates before they expire Configures OCSP stapling Uses modern TLS settings Reverse Proxy example . com { reverse_proxy / api /* localhost : 8080 reverse_proxy / ws /* localhost : 8081 root * / var / www / html file_server } Load Balancing example . com { reverse_proxy localhost : 3001 localhost : 3002 localhost : 3003 { lb_policy round_robin health_uri / health health_interval 10 s } } SPA Routing example . com { root * / var / www / app try_files { path } / index . html

Continue reading on Dev.to DevOps

Opens in a new tab

Read Full Article
7 views

Related Articles