book/Caddyfile
2023-09-25 22:51:18 +03:00

55 lines
No EOL
2.5 KiB
Caddyfile

{
# https://caddyserver.com/docs/caddyfile/options
email "privat@lukas-potthast.de"
http_port {$HTTP_PORT}
https_port {$HTTPS_PORT}
storage consul {
address "{$CONSUL_HTTP_ADDR}"
token "consul-access-token"
timeout 10
prefix ""
value_prefix "caddytlsprefix"
aes_key "consultls-1234567890-caddytls-32"
tls_enabled "false"
tls_insecure "true"
}
}
{$ADDRESS_PREFIX}:{$HTTPS_PORT} {
tls /etc/certs/letsencrypt/www.leptonic.dev-cert.pem /etc/certs/letsencrypt/www.leptonic.dev-key.pem
# redir {$URL_PREFIX} {$URL_PREFIX}/
handle_path {$URL_PREFIX}* {
root * /srv
try_files {path} /index.html
encode {
gzip
match {
header Content-Type text/*
header Content-Type application/json*
header Content-Type application/js*
header Content-Type application/javascript*
header Content-Type application/wasm*
header Content-Type application/xhtml+xml*
header Content-Type application/atom+xml*
header Content-Type application/rss+xml*
header Content-Type image/svg+xml*
header Content-Type image/*
}
}
# header Cache-Control max-age=0,no-cache,no-store,must-revalidate
# header index.html Cache-Control max-age=0,no-cache,no-store,must-revalidate
# header service-worker.js Cache-Control max-age=0,no-cache,no-store,must-revalidate
# header manifest.json Cache-Control max-age=0,no-cache,no-store,must-revalidate
# header robots.txt Cache-Control max-age=0,no-cache,no-store,must-revalidate
# header js/* Cache-Control max-age=0,no-cache,no-store,must-revalidate
# header * Cache-Control max-age=31536000
header Cache-Control max-age=0,no-cache,no-store,must-revalidate
file_server
}
handle {
respond "Not found" 404
}
}