Static handles must use host-level root + prefix match (/monitoring*), not root=…/monitoring with handle /monitoring/ (double path → empty 404).
40 lines
1.4 KiB
Text
40 lines
1.4 KiB
Text
# Host Caddy (root service). Place BEFORE catch-all reverse_proxy in each site block.
|
|
#
|
|
# CRITICAL (v1.7.2): root must be the *host directory* (…/monitoring-sites/{host}),
|
|
# and the matcher must be a path *prefix* (`/monitoring*`), so that URI
|
|
# /monitoring/index.html maps to {root}/monitoring/index.html.
|
|
#
|
|
# WRONG (causes empty HTTP 404 from Caddy file_server):
|
|
# handle /monitoring/ {
|
|
# root * …/monitoring-sites/{host}/monitoring
|
|
# file_server
|
|
# }
|
|
# → looks for …/monitoring/monitoring/index.html
|
|
#
|
|
# Disk layout:
|
|
# /var/www/monitoring-sites/{host}/monitoring/index.html
|
|
# /var/www/monitoring-sites/taler.hacktivism.ch/taler-monitoring-*/index.html
|
|
|
|
# --- only inside taler.hacktivism.ch { ... } ---
|
|
handle /taler-monitoring-surface* {
|
|
root * /var/www/monitoring-sites/taler.hacktivism.ch
|
|
file_server
|
|
}
|
|
handle /taler-monitoring-aptdeploy* {
|
|
root * /var/www/monitoring-sites/taler.hacktivism.ch
|
|
file_server
|
|
}
|
|
handle /taler-monitoring-mattermost* {
|
|
root * /var/www/monitoring-sites/taler.hacktivism.ch
|
|
file_server
|
|
}
|
|
handle /taler-monitoring-mail* {
|
|
root * /var/www/monitoring-sites/taler.hacktivism.ch
|
|
file_server
|
|
}
|
|
|
|
# --- bank + exchange + taler (each site block; set root host dir) ---
|
|
handle /monitoring* {
|
|
root * /var/www/monitoring-sites/{host}
|
|
file_server
|
|
}
|