docs: Replaced http.cat example with single line respond (#106)

* Fix http.cat example with Host

* Add simpler example using respond
This commit is contained in:
Andy Pilate 2020-11-23 19:22:19 +01:00 committed by GitHub
parent caefac9b51
commit 570488d7f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -48,6 +48,16 @@ Reverse proxy to a professional server that is highly qualified for handling HTT
```caddy ```caddy
handle_errors { handle_errors {
rewrite * /{http.error.status_code} rewrite * /{http.error.status_code}
reverse_proxy https://http.cat reverse_proxy https://http.cat {
header_up Host http.cat
}
}
```
Simply use [`respond`](/docs/caddyfile/directives/respond) to return the error code and name
```caddy
handle_errors {
respond "{http.error.status_code} {http.error.status_text}"
} }
``` ```