handle errors

This commit is contained in:
Florian Zirker 2024-12-10 16:29:08 +01:00
parent 1490487e7b
commit e59dbe314f

View file

@ -6,6 +6,15 @@
}
}
(error) {
root * /usr/share/caddy
rewrite * /error.html
templates
file_server {
status {err.status_code}
}
}
*.{$DOMAIN} {
tls {
dns netcup {
@ -79,7 +88,23 @@
# Fallback for otherwise unhandled domains
handle {
respond 404
respond "404 Not Found" 404
}
# handle wrong url pathes
handle_errors 404 {
#respond "{err.status_code} {err.status_text}" {err.status_code}
import error
}
# handle errors of proxy backends are down
# handle_errors 502 {
# respond "503 Service Unavailable" 503
# }
# every other error
handle_errors {
import error
}
}