docs: Mention the file matcher placeholders in the caddyfile docs (#81)

This commit is contained in:
Francis Lavoie 2020-08-31 15:56:44 -04:00 committed by GitHub
parent f1d0d13522
commit 81a9b3c54d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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). 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: #### Examples:
Match requests where the path is a file that exists. Match requests where the path is a file that exists.