docs: Mention the file matcher placeholders in the caddyfile docs

This commit is contained in:
Francis Lavoie 2020-08-28 01:00:35 -04:00
parent f1d0d13522
commit 5f89958979
No known key found for this signature in database
GPG key ID: 7D1A27F0725BE5D8

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.