summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/fileserver/caddyfile.go
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2019-11-15 12:47:38 -0700
committerMatthew Holt <mholt@users.noreply.github.com>2019-11-15 12:47:38 -0700
commit0ca109db4ab0b8869a15d388ef9036d9117ec081 (patch)
treea256f55db132575b8a8d44a1ff253b3456643bc9 /modules/caddyhttp/fileserver/caddyfile.go
parent0fc97211abd46098f5953fc6b152aa891060fca5 (diff)
Minor cleanups
Diffstat (limited to 'modules/caddyhttp/fileserver/caddyfile.go')
-rw-r--r--modules/caddyhttp/fileserver/caddyfile.go15
1 files changed, 15 insertions, 0 deletions
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 <files...>
+//
+// and is shorthand for:
+//
+// matcher:try_files {
+// file {
+// try_files <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()