handle errors
This commit is contained in:
parent
1490487e7b
commit
e59dbe314f
1 changed files with 26 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue