2021-08-01 16:59:16 -05:00
|
|
|
# vim: ft=caddyfile
|
|
|
|
|
|
|
|
{
|
2022-01-30 17:31:09 -06:00
|
|
|
grace_period 30s
|
2021-08-01 16:59:16 -05:00
|
|
|
import email
|
|
|
|
}
|
|
|
|
|
|
|
|
#{
|
|
|
|
# servers :443 {
|
|
|
|
# protocol {
|
|
|
|
# experimental_http3
|
|
|
|
# }
|
|
|
|
# }
|
|
|
|
#}
|
|
|
|
|
|
|
|
(basicerrors) {
|
|
|
|
handle_errors {
|
|
|
|
#respond "{http.error.status_code} {http.error.status_text}"
|
|
|
|
|
2021-08-21 17:18:23 -05:00
|
|
|
templates
|
|
|
|
rewrite * /index.html
|
|
|
|
root * /etc/caddy/errors
|
2021-08-01 16:59:16 -05:00
|
|
|
file_server
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-04 16:47:16 -05:00
|
|
|
(hsts) {
|
|
|
|
header Strict-Transport-Security max-age=31536000
|
|
|
|
}
|
|
|
|
|
2021-08-15 13:38:54 -05:00
|
|
|
(matrix-well-known) {
|
2021-08-15 14:00:27 -05:00
|
|
|
handle_path /.well-known/matrix/* {
|
2021-08-15 13:38:54 -05:00
|
|
|
header Access-Control-Allow-Origin "*"
|
|
|
|
header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS"
|
|
|
|
header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, Authorization"
|
|
|
|
|
2021-08-15 14:00:27 -05:00
|
|
|
rewrite * {path}.json
|
|
|
|
root * /etc/caddy/matrix_well_known
|
|
|
|
file_server
|
2021-08-15 13:38:54 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-30 00:06:10 -05:00
|
|
|
(log) {
|
|
|
|
log {
|
2021-12-17 21:01:01 -06:00
|
|
|
output file /var/log/caddy/access.log {
|
|
|
|
roll_size 1GiB
|
|
|
|
roll_keep 5
|
|
|
|
roll_keep_for 168h
|
|
|
|
}
|
2021-10-30 00:06:10 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-08-01 16:59:16 -05:00
|
|
|
import conf.d/*
|