galaxy-caddy.http.sync/templates/http.caddy.j2

46 lines
1.1 KiB
Django/Jinja

{{ vhost_url }} {
header / {
# Enable HTTP Strict Transport Security (HSTS) to force clients to always
# connect via HTTPS (do not use if only testing)
Strict-Transport-Security "max-age=31536000;"
# Enable cross-site filter (XSS) and tell browser to block detected attacks
X-XSS-Protection "1; mode=block"
# Prevent some browsers from MIME-sniffing a response away from the declared Content-Type
X-Content-Type-Options "nosniff"
# Disallow the site to be rendered within a frame (clickjacking protection)
X-Frame-Options "DENY"
}
log {{ caddy_logs }}/{{ vhost_name }}/access.log {
rotate_size 100
rotate_age 30
rotate_keep 10
}
errors {{ caddy_logs }}/{{ vhost_name }}/errors.log {
rotate_size 100
rotate_age 30
rotate_keep 10
}
root {{ caddy_www }}/{{ vhost_name }}
gzip
{% if custom_errors %}
errors {
404 404.html # Not Found
}
{% endif %}
}
{% if www_redirect %}
www.{{ vhost_url }} {
redir https://{{ vhost_url }}
}
{% endif %}