From fdabac51a8c8801840679a24e371f23013b021bb Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Sun, 29 Dec 2019 13:16:34 -0700 Subject: Improve docs, especially w.r.t. placeholders and template actions --- modules/caddyhttp/fileserver/matcher.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'modules/caddyhttp/fileserver') diff --git a/modules/caddyhttp/fileserver/matcher.go b/modules/caddyhttp/fileserver/matcher.go index 6c1e880..c119865 100644 --- a/modules/caddyhttp/fileserver/matcher.go +++ b/modules/caddyhttp/fileserver/matcher.go @@ -33,10 +33,20 @@ func init() { // MatchFile is an HTTP request matcher that can match // requests based upon file existence. +// +// Upon matching, two new placeholders will be made +// available: +// +// - `{http.matchers.file.relative}` The root-relative +// path of the file. This is often useful when rewriting +// requests. +// - `{http.matchers.file.absolute}` The absolute path +// of the matched file. type MatchFile struct { // The root directory, used for creating absolute // file paths, and required when working with - // relative paths; if not specified, the current + // relative paths; if not specified, `{http.vars.root}` + // will be used, if set; otherwise, the current // directory is assumed. Accepts placeholders. Root string `json:"root,omitempty"` -- cgit v1.2.3