73 lines
2.5 KiB
Text
73 lines
2.5 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
|
|
#
|
|
# CRITICAL (v1.9.2): bare-path redir inside handle MUST use matcher `*`:
|
|
# handle /taler-monitoring-surface {
|
|
# redir * /taler-monitoring-surface/ 302
|
|
# }
|
|
# WRONG: `redir /taler-monitoring-surface/ 302` is parsed as
|
|
# matcher=/taler-monitoring-surface/ to="302" → Location: 302, merchant code 21
|
|
# (same footgun for /monitoring, aptdeploy, mail, mattermost bare paths).
|
|
#
|
|
# Disk layout:
|
|
# /var/www/monitoring-sites/{host}/monitoring/index.html
|
|
# /var/www/monitoring-sites/taler.hacktivism.ch/taler-monitoring-*/index.html
|
|
#
|
|
# Live apply on koopa (absolute path — ~ as root is /root):
|
|
# sudo /home/hernani/koopa-caddy/apply-monitoring-live.sh
|
|
|
|
# --- only inside taler.hacktivism.ch { ... } ---
|
|
handle /taler-monitoring-surface {
|
|
redir * /taler-monitoring-surface/ 302
|
|
}
|
|
handle /taler-monitoring-surface* {
|
|
root * /var/www/monitoring-sites/taler.hacktivism.ch
|
|
file_server
|
|
}
|
|
handle /taler-monitoring-surface_err {
|
|
redir * /taler-monitoring-surface_err/ 302
|
|
}
|
|
handle /taler-monitoring-surface_err* {
|
|
root * /var/www/monitoring-sites/taler.hacktivism.ch
|
|
file_server
|
|
}
|
|
handle /taler-monitoring-aptdeploy {
|
|
redir * /taler-monitoring-aptdeploy/ 302
|
|
}
|
|
handle /taler-monitoring-aptdeploy* {
|
|
root * /var/www/monitoring-sites/taler.hacktivism.ch
|
|
file_server
|
|
}
|
|
handle /taler-monitoring-aptdeploy_err {
|
|
redir * /taler-monitoring-aptdeploy_err/ 302
|
|
}
|
|
handle /taler-monitoring-aptdeploy_err* {
|
|
root * /var/www/monitoring-sites/taler.hacktivism.ch
|
|
file_server
|
|
}
|
|
|
|
# --- bank + exchange + taler (each site block; set root host dir) ---
|
|
handle /monitoring {
|
|
redir * /monitoring/ 302
|
|
}
|
|
handle /monitoring* {
|
|
root * /var/www/monitoring-sites/{host}
|
|
file_server
|
|
}
|
|
handle /monitoring_err {
|
|
redir * /monitoring_err/ 302
|
|
}
|
|
handle /monitoring_err* {
|
|
root * /var/www/monitoring-sites/{host}
|
|
file_server
|
|
}
|