diff options
author | Matthew Holt <mholt@users.noreply.github.com> | 2019-11-15 12:47:38 -0700 |
---|---|---|
committer | Matthew Holt <mholt@users.noreply.github.com> | 2019-11-15 12:47:38 -0700 |
commit | 0ca109db4ab0b8869a15d388ef9036d9117ec081 (patch) | |
tree | a256f55db132575b8a8d44a1ff253b3456643bc9 /modules/caddyhttp | |
parent | 0fc97211abd46098f5953fc6b152aa891060fca5 (diff) |
Minor cleanups
Diffstat (limited to 'modules/caddyhttp')
-rw-r--r-- | modules/caddyhttp/fileserver/caddyfile.go | 15 |
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() |