-
-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Mohammed Al Sahaf <[email protected]> Co-authored-by: Francis Lavoie <[email protected]> Co-authored-by: Nebez Briefkani <[email protected]> Co-authored-by: Mohammed Al Sahaf <[email protected]>
- Loading branch information
1 parent
1a82466
commit ca9ce7b
Showing
22 changed files
with
549 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
title: fs (Caddyfile directive) | ||
--- | ||
|
||
# fs | ||
|
||
Sets which file system should be used for performing file I/O. | ||
|
||
This could let you connect to a remote filesystem running in the cloud, or a database with a file-like interface, or even to read from files embedded within the Caddy binary. | ||
|
||
First, you must declare a file system name using the [`filesystem` global option](/docs/caddyfile/options#filesystem), then you can use this directive to specify which file system to use. | ||
|
||
This directive is often used in conjunction with the [`file_server` directive](file_server) to serve static files, or the [`try_files` directive](try_files) to perform rewrites based on the existence of files. Typically also used with [`root` directive](root) to set the root path within the file system. | ||
|
||
|
||
## Syntax | ||
|
||
```caddy-d | ||
fs [<matcher>] <filesystem> | ||
``` | ||
|
||
## Examples | ||
|
||
Using an file system named `foo`, using an imaginary module named `custom` which might require authentication: | ||
|
||
```caddy | ||
{ | ||
filesystem foo custom { | ||
api_key abc123 | ||
} | ||
} | ||
example.com { | ||
fs foo | ||
root /srv | ||
file_server | ||
} | ||
``` | ||
|
||
To only serve images from the `foo` file system, and the rest from the default file system: | ||
|
||
```caddy | ||
example.com { | ||
fs /images* foo | ||
root /srv | ||
file_server | ||
} | ||
``` |
Oops, something went wrong.