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

10 lines
292 B
Caddyfile

# HTTPS in front of the Node.js app. Caddy gets and renews the certificate for $DOMAIN on its own.
{$DOMAIN} {
encode zstd gzip
reverse_proxy app:3000
}
# www.example goes to the domain without www. Needs a DNS record for www too.
www.{$DOMAIN} {
redir https://{$DOMAIN}{uri} permanent
}