24 строки
658 B
Caddyfile
24 строки
658 B
Caddyfile
{
|
|
email [EMAIL]
|
|
}
|
|
|
|
# Snippet riutilizzabile: mostra errorr.html quando il backend non risponde
|
|
# (502/503/504). Va importato dentro il blocco di ogni sito che fa reverse_proxy.
|
|
(gateway_error) {
|
|
handle_errors {
|
|
@gateway_error expression `{http.error.status_code} in [502, 503, 504]`
|
|
handle @gateway_error {
|
|
root * /etc/caddy/html
|
|
rewrite * /error.html
|
|
file_server
|
|
}
|
|
handle {
|
|
respond "{http.error.status_code} {http.error.status_text}" {http.error.status_code}
|
|
}
|
|
}
|
|
}
|
|
|
|
# Ogni servizio ha il proprio file in /srv/containers/caddy/sites/*.caddy
|
|
# (sorgente in git: containers/<servizio>/<servizio>.caddy)
|
|
import /etc/caddy/sites/*.caddy
|