From 9af5f369511eefea691a5cb6787a31ef3af53a0a Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Thu, 9 Dec 2021 03:00:23 +0100 Subject: Static: supporting new "index" option. This supports a new option "index" that configures a custom index file name to be served when a directory is requested. This initial support only allows a single fixed string. An example: { "share": "/www/data/static/$uri", "index": "lookatthis.htm" } When is requested, is served. Default is "index.html". === nxt_conf_validator.c: Accept "index" as a member of "share", and make sure it's a string. === I tried this feature in my own computer, where I tried the following: - Setting "index" to "lookatthis.htm", and check that the correct file is being served (check both a different name and a different extension). - Not setting "index", and check that is being served. - Settind "index" to an array of strings, and check that the configuration fails: { "error": "Invalid configuration.", "detail": "The \"index\" value must be a string, but not an array." } --- docs/changes.xml | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'docs/changes.xml') diff --git a/docs/changes.xml b/docs/changes.xml index 98650051..db352022 100644 --- a/docs/changes.xml +++ b/docs/changes.xml @@ -43,6 +43,12 @@ supporting empty strings in the "location" option of the "return" action. + + +ability to specify a custom index file name when serving static files. + + + variables support in the "location" option of the "return" action. -- cgit