-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Description
Followup on #4909
Consider a config like this:
root * /srv
try_files {path} /index.html
file_server
If you switch to using a virtual filesystem, of course you'd need try_files
and file_server
to use the same filesystem, otherwise it wouldn't really make sense.
Defining the filesystem to use for each directive that might need it doesn't seem very nice, so we need to come up with a solution for defining it once early in the pipeline, and have any of these routes pick it up from the request context (similarly to how root
sets a variable to be used later).
We could introduce an fs
directive for this, which takes a virtual FS module and then puts a reference to it in context, which file_server
and the file
matcher can use by default if not otherwise explicitly configured (and if neither, use the local filesystem of course)