diff options
author | Matthew Holt <mholt@users.noreply.github.com> | 2019-12-29 13:16:34 -0700 |
---|---|---|
committer | Matthew Holt <mholt@users.noreply.github.com> | 2019-12-29 13:16:34 -0700 |
commit | fdabac51a8c8801840679a24e371f23013b021bb (patch) | |
tree | 90ca5dfd899a98b702e86886b113628b420aec94 /modules/caddyhttp/fileserver | |
parent | 95d944613bffce1cee3783568ae229e116168ba4 (diff) |
Improve docs, especially w.r.t. placeholders and template actions
Diffstat (limited to 'modules/caddyhttp/fileserver')
-rw-r--r-- | modules/caddyhttp/fileserver/matcher.go | 12 |
1 files changed, 11 insertions, 1 deletions
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"` |