Skip to content

Define a virtual FS to use for all subsequent routes  #5057

@francislavoie

Description

@francislavoie

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions