Caddy Modern Config
When to use this skill
-
Configuring Caddy as a web server or reverse proxy.
-
Setting up local HTTPS.
-
Deploying PHP/Python apps with Caddy.
- Caddyfile Basics
-
Syntax: domain { directives } .
-
Auto-HTTPS: Enabled by default for any host that looks like a domain.
- Reverse Proxy
- Python/Node: example.com { reverse_proxy localhost:3000 }
- PHP (FastCGI)
- Directives: Use php_fastcgi preset. example.com { root * /var/www/site/public php_fastcgi unix//run/php/php8.3-fpm.sock file_server }
- Security
- Headers: Add basic security headers easily. header { Strict-Transport-Security "max-age=31536000;" X-Content-Type-Options "nosniff" }