mirror of
https://github.com/caddyserver/website.git
synced 2025-04-21 12:36:16 -04:00
docs: Add errors directive to v2 upgrade guide (#53)
* Errors upgrade docs Based on https://github.com/caddyserver/caddy/issues/3336 discussion. * Tab vs spaces; fix copy-paste error. * With requested changes.
This commit is contained in:
parent
41833df85d
commit
c659f37d14
1 changed files with 23 additions and 0 deletions
|
@ -20,6 +20,7 @@ This guide won't delve into the new features available -- which are really cool,
|
||||||
- [Primary changes](#primary-changes)
|
- [Primary changes](#primary-changes)
|
||||||
- [basicauth](#basicauth)
|
- [basicauth](#basicauth)
|
||||||
- [browse](#browse)
|
- [browse](#browse)
|
||||||
|
- [errors](#errors)
|
||||||
- [ext](#ext)
|
- [ext](#ext)
|
||||||
- [fastcgi](#fastcgi)
|
- [fastcgi](#fastcgi)
|
||||||
- [gzip](#gzip)
|
- [gzip](#gzip)
|
||||||
|
@ -146,6 +147,28 @@ browse /subfolder/
|
||||||
file_server /subfolder/* browse
|
file_server /subfolder/* browse
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### errors
|
||||||
|
|
||||||
|
Custom error pages can be accomplished with [`handle_errors`](/docs/caddyfile/directives/handle_errors).
|
||||||
|
|
||||||
|
|
||||||
|
- **v1:**:
|
||||||
|
|
||||||
|
```
|
||||||
|
errors {
|
||||||
|
404 404.html
|
||||||
|
500 500.html
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- **v2:**:
|
||||||
|
|
||||||
|
```
|
||||||
|
handle_errors {
|
||||||
|
rewrite * /{http.error.status_code}.html
|
||||||
|
file_server
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### ext
|
### ext
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue