From 0ca109db4ab0b8869a15d388ef9036d9117ec081 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Fri, 15 Nov 2019 12:47:38 -0700 Subject: Minor cleanups --- modules/caddyhttp/fileserver/caddyfile.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'modules/caddyhttp/fileserver') diff --git a/modules/caddyhttp/fileserver/caddyfile.go b/modules/caddyhttp/fileserver/caddyfile.go index b50c166..06540bc 100644 --- a/modules/caddyhttp/fileserver/caddyfile.go +++ b/modules/caddyhttp/fileserver/caddyfile.go @@ -83,6 +83,21 @@ func parseCaddyfile(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHandler, error) return &fsrv, nil } +// parseTryFiles parses the try_files directive. It combines a file matcher +// with a rewrite directive, so this is not a standard handler directive. +// A try_files directive has this syntax (notice no matcher tokens accepted): +// +// try_files +// +// and is shorthand for: +// +// matcher:try_files { +// file { +// try_files +// } +// } +// rewrite match:try_files {http.matchers.file.relative}{http.request.uri.query_string} +// func parseTryFiles(h httpcaddyfile.Helper) ([]httpcaddyfile.ConfigValue, error) { if !h.Next() { return nil, h.ArgErr() -- cgit v1.2.3