docs: first_exist_fallback try policy (#444)

This commit is contained in:
Kévin Dunglas 2025-01-09 17:48:44 +01:00 committed by GitHub
parent dbd9cc7948
commit 7b80cfe08f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View file

@ -11,7 +11,7 @@ Rewrites the request URI path to the first of the listed files which exists in t
```caddy-d
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
}
```

View file

@ -300,7 +300,7 @@ respond @api "Hello, API!"
file {
root <path>
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...>
}
file <files...>
@ -308,7 +308,7 @@ file <files...>
expression `file({
'root': '<path>',
'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...>']
})`
expression file('<files...>')
@ -330,6 +330,8 @@ By files.
- `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.
- `largest_size` chooses the file with the largest size.