improve errors

This commit is contained in:
Florian Zirker 2024-12-11 09:09:31 +01:00
parent e59dbe314f
commit 230fb50d3a

View file

@ -6,15 +6,6 @@
}
}
(error) {
root * /usr/share/caddy
rewrite * /error.html
templates
file_server {
status {err.status_code}
}
}
*.{$DOMAIN} {
tls {
dns netcup {
@ -86,25 +77,18 @@
reverse_proxy nginx-mailcow:8090
}
# Fallback for otherwise unhandled domains
# Fallback unhandled (sub)domains
handle {
respond "404 Not Found" 404
error 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
root * /usr/share/caddy
rewrite * /error.html
templates
file_server {
status {err.status_code}
}
}
}