mirror of
https://github.com/caddyserver/website.git
synced 2025-04-21 04:26:16 -04:00
docs: Add handle_errors, CEL matcher; a few other improvements
This commit is contained in:
parent
e8e0ec148b
commit
f4a2d34127
5 changed files with 45 additions and 1 deletions
|
@ -13,7 +13,7 @@ A static file server. It works by appending the request's URI path to the [site'
|
|||
file_server [<matcher>] [browse] {
|
||||
root <path>
|
||||
hide <files...>
|
||||
index <files...>
|
||||
index <filenames...>
|
||||
browse [<template_file>]
|
||||
}
|
||||
```
|
||||
|
@ -21,6 +21,7 @@ file_server [<matcher>] [browse] {
|
|||
- **browse** enables file listings for requests to directories that do not have an index file.
|
||||
- **root** sets the path to the site root for just this file server instance, overriding any other. Default: `{http.vars.root}` or the current working directory. Note: When specified as a subdirective like this, only this directive will know this root; for other directives (like [try_files](/docs/caddyfile/directives/try_files) or [templates](/docs/caddyfile/directives/templates)) to know the same site root, use the [root](/docs/caddyfile/directives/root) directive, not subdirective.
|
||||
- **hide** is a list of files to hide; if requested, the file server will pretend they do not exist. The active configuration file will be added by default.
|
||||
- **index** is a list of filenames to look for as index files. Default: `index.html index.txt`
|
||||
- **<template_file>** is an optional custom template file to use for directory listings.
|
||||
|
||||
|
||||
|
|
19
src/docs/markdown/caddyfile/directives/handle_errors.md
Normal file
19
src/docs/markdown/caddyfile/directives/handle_errors.md
Normal file
|
@ -0,0 +1,19 @@
|
|||
---
|
||||
title: handle_errors (Caddyfile directive)
|
||||
---
|
||||
|
||||
# handle_errors
|
||||
|
||||
Sets up error handlers.
|
||||
|
||||
When the normal HTTP request handlers return an error, normal procesing stops and the error handlers are invoked. Error handlers form a route which is just like normal routes, and they can do anything that normal routes can do. This enables great control and flexibility when handling errors during HTTP requests.
|
||||
|
||||
## Syntax
|
||||
|
||||
```
|
||||
handle_errors {
|
||||
<directives...>
|
||||
}
|
||||
```
|
||||
|
||||
- **<directives...>** is a list of HTTP handler directives, directive blocks, or matchers; one per line.
|
Loading…
Add table
Add a link
Reference in a new issue