mirror of
https://github.com/caddyserver/website.git
synced 2025-04-20 12:15:08 -04:00
docs: first_exist_fallback try policy
This commit is contained in:
parent
dbd9cc7948
commit
61e6f86072
2 changed files with 5 additions and 3 deletions
|
@ -11,7 +11,7 @@ Rewrites the request URI path to the first of the listed files which exists in t
|
||||||
|
|
||||||
```caddy-d
|
```caddy-d
|
||||||
try_files <files...> {
|
try_files <files...> {
|
||||||
policy first_exist|smallest_size|largest_size|most_recently_modified
|
policy first_exist|first_exist_fallback|smallest_size|largest_size|most_recently_modified
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -300,7 +300,7 @@ respond @api "Hello, API!"
|
||||||
file {
|
file {
|
||||||
root <path>
|
root <path>
|
||||||
try_files <files...>
|
try_files <files...>
|
||||||
try_policy first_exist|smallest_size|largest_size|most_recently_modified
|
try_policy first_exist|first_exist_fallback|smallest_size|largest_size|most_recently_modified
|
||||||
split_path <delims...>
|
split_path <delims...>
|
||||||
}
|
}
|
||||||
file <files...>
|
file <files...>
|
||||||
|
@ -308,7 +308,7 @@ file <files...>
|
||||||
expression `file({
|
expression `file({
|
||||||
'root': '<path>',
|
'root': '<path>',
|
||||||
'try_files': ['<files...>'],
|
'try_files': ['<files...>'],
|
||||||
'try_policy': 'first_exist|smallest_size|largest_size|most_recently_modified',
|
'try_policy': 'first_exist|first_exist_fallback|smallest_size|largest_size|most_recently_modified',
|
||||||
'split_path': ['<delims...>']
|
'split_path': ['<delims...>']
|
||||||
})`
|
})`
|
||||||
expression file('<files...>')
|
expression file('<files...>')
|
||||||
|
@ -330,6 +330,8 @@ By files.
|
||||||
|
|
||||||
- `first_exist` checks for file existence. The first file that exists is selected.
|
- `first_exist` checks for file existence. The first file that exists is selected.
|
||||||
|
|
||||||
|
- `first_exist_fallback` is similar to `first_exist`, but assumes that the last element in the list always exists to prevent a disk access.
|
||||||
|
|
||||||
- `smallest_size` chooses the file with the smallest size.
|
- `smallest_size` chooses the file with the smallest size.
|
||||||
|
|
||||||
- `largest_size` chooses the file with the largest size.
|
- `largest_size` chooses the file with the largest size.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue