templates/php-app/Caddyfile
2026-11-28 15:28:02 +02:00

12 lines
315 B
Caddyfile

# HTTPS in front of PHP-FPM. Caddy gets and renews the certificate for $DOMAIN on its own.
{$DOMAIN} {
encode zstd gzip
root * /srv/public
php_fastcgi php:9000
file_server
}
# www.example goes to the domain without www. Needs a DNS record for www too.
www.{$DOMAIN} {
redir https://{$DOMAIN}{uri} permanent
}