mirror of
https://github.com/caddyserver/website.git
synced 2025-06-15 02:34:51 -04:00
new: file_server.sort
This commit is contained in:
parent
abdb76f083
commit
c97f6ba26f
1 changed files with 7 additions and 0 deletions
|
@ -40,6 +40,7 @@ file_server [<matcher>] [browse] {
|
|||
status <status>
|
||||
disable_canonical_uris
|
||||
pass_thru
|
||||
sort <options...>
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -69,6 +70,12 @@ file_server [<matcher>] [browse] {
|
|||
|
||||
- **pass_thru** <span id="pass_thru"/> enables pass-thru mode, which continues to the next HTTP handler in the route if the requested file is not found, instead of triggering a `404` error (invoking [`handle_errors`](handle_errors) routes). Practically, this is only useful inside of a [`route`](route) block with other handler directives following `file_server`, because this directive is effectively [ordered last](/docs/caddyfile/directives#directive-order).
|
||||
|
||||
- **sort** <span id="sort"/> specifies how to sort directory listings. The `options` can be `sortBy` and `order` separated by spaces.
|
||||
|
||||
- **sortBy** can be one of `name`, `size`, `time`. Default: `name`
|
||||
|
||||
- **order** can be one of `asc` or `desc`. Default: `asc`
|
||||
|
||||
## Examples
|
||||
|
||||
A static file server out of the current directory:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue