Skip to content

static files

User65k edited this page Feb 27, 2023 · 2 revisions

Used to deliver static files from the server to clients on GET requests.

Config

Specify at lest the key dir in a mount path.

key meaning
dir local folder to serve files from
follow_symlinks Optional Allow symlinks to be followed to resolve requests. If false (default) all resolved files are canonicalized and compared against the canonicalized form of "dir"
index Optional if a directory is requested, look for one of these files and serve it
serve Optional only serve files with these extensions

Examples

Linux, follow symlinks, only serve certain file extensions and look for index files:

dir = "/var/www/"
follow_symlinks = true
index = ["index.html", "index.htm"]
serve = ["html", "htm", "css", "js", "png", "jpeg", "jpg"]

Windows, dont follow symlinks, serve everything:

dir = 'C:\inetpub\wwwroot'

Clone this wiki locally