Skip to content

mount path

User65k edited this page Oct 10, 2021 · 8 revisions

One or more mount paths can be used in one virtual host. Each key that is not used in a vHost config will become a mount path. To set a mount path on the server root (/) specify it directly with the vHost keys.

A mount holds a specific use case static files, FCGI, webdav, a websocket, ... on a particular HTTP path on the server.

If you want to mount on a keyword (like /ip) prefix it with grave accent "`". If you want to mount on something beginning with grave accent use two.

Config

Depends on the specific use case. The following keys are always available:

key
header Optional add default header to a response. A header will be only set if it is not already set.
auth Optional Require user authentication from the client

Example

[server]
ip = "127.0.0.1:80"
dir = "target"  # Use case: static files on /*

[server.mnt]
dir = "other_target"  # Use case: static files on /mnt/*
# Optional: Set some headers if they were not present before
header = {Referrer-Policy = "strict-origin-when-cross-origin", Feature-Policy = "microphone 'none'; geolocation 'none'"}
auth = {type = "Digest", realm = "test", userfile = ".htdigest"}

[server."mnt/deep/nested/path"]
dir = "something_else"  # Use case: static files on /mnt/deep/nested/path/*

[server."`ip"]
#mount on a keyword
dir = "fun/key"  # Use case: static files on /ip/*

[server."``fun"]
#mount on something beginning with grave accent
dir = "fun/target"  # Use case: static files on /`fun/*

Clone this wiki locally