caddyhttp: Add split_path to file matcher (used by php_fastcgi) (#3302)

* matcher: Add `split_path` option to file matcher; used in php_fastcgi

* matcher: Skip try_files split if not the final part of the filename

* matcher: Add MatchFile tests

* matcher: Clarify SplitPath godoc
This commit is contained in:
Francis Lavoie
2020-04-27 16:46:46 -04:00
committed by GitHub
parent 83c85c53f5
commit 5ae1a5617c
9 changed files with 342 additions and 188 deletions
@@ -149,6 +149,7 @@ func parsePHPFastCGI(h httpcaddyfile.Helper) ([]httpcaddyfile.ConfigValue, error
rewriteMatcherSet := caddy.ModuleMap{
"file": h.JSON(fileserver.MatchFile{
TryFiles: []string{"{http.request.uri.path}", "{http.request.uri.path}/index.php", "index.php"},
SplitPath: []string{".php"},
}),
}
rewriteHandler := rewrite.Rewrite{