mirror of
https://github.com/caddyserver/website.git
synced 2025-04-21 20:46:15 -04:00
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:
parent
caefac9b51
commit
570488d7f6
1 changed files with 11 additions and 1 deletions
|
@ -48,6 +48,16 @@ Reverse proxy to a professional server that is highly qualified for handling HTT
|
|||
```caddy
|
||||
handle_errors {
|
||||
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}"
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue