19 linhas
438 B
Caddyfile
19 linhas
438 B
Caddyfile
# Serves public/ with HTTPS. Caddy gets and renews the certificate for $DOMAIN on its own.
|
|
{$DOMAIN} {
|
|
encode zstd gzip
|
|
root * /srv
|
|
file_server
|
|
handle_errors {
|
|
rewrite * /404.html
|
|
file_server
|
|
}
|
|
header {
|
|
X-Content-Type-Options nosniff
|
|
Referrer-Policy strict-origin-when-cross-origin
|
|
}
|
|
}
|
|
|
|
# www.example goes to the domain without www. Needs a DNS record for www too.
|
|
www.{$DOMAIN} {
|
|
redir https://{$DOMAIN}{uri} permanent
|
|
}
|