mirror of
https://github.com/caddyserver/website.git
synced 2025-04-21 20:46:15 -04:00
docs: Mention the file matcher placeholders in the caddyfile docs (#81)
This commit is contained in:
parent
f1d0d13522
commit
81a9b3c54d
1 changed files with 5 additions and 0 deletions
|
@ -211,6 +211,11 @@ An empty `file` matcher (one with no files listed after it) will see if the requ
|
|||
|
||||
Since rewriting based on the existence of a file on disk is so common, there is also a [`try_files` directive](/docs/caddyfile/directives/try_files) which is a shortcut of the `file` matcher and a [`rewrite` handler](/docs/caddyfile/directives/rewrite).
|
||||
|
||||
Upon matching, two new placeholders will be made available:
|
||||
|
||||
- `{http.matchers.file.relative}` The root-relative path of the file. This is often useful when rewriting requests.
|
||||
- `{http.matchers.file.absolute}` The absolute path of the matched file.
|
||||
|
||||
#### Examples:
|
||||
|
||||
Match requests where the path is a file that exists.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue