diff options
author | Matthew Holt <[email protected]> | 2019-12-12 15:27:09 -0700 |
---|---|---|
committer | Matthew Holt <[email protected]> | 2019-12-12 15:27:09 -0700 |
commit | 5e9d81b507e0beb46b3812e21566bfef79c87af4 (patch) | |
tree | 86db08206e19897d13625765f94f870b714d92d7 /modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go | |
parent | 09a851706541317a36c7cc8ee58152a0a2fa3279 (diff) | |
download | caddy-5e9d81b507e0beb46b3812e21566bfef79c87af4.tar.gz caddy-5e9d81b507e0beb46b3812e21566bfef79c87af4.zip |
try_files, rewrite: allow query string in try_files (fix #2891)
Also some minor cleanup/improvements discovered along the way
Diffstat (limited to 'modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go')
-rw-r--r-- | modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go b/modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go index 8e723b2c4..699f6808a 100644 --- a/modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go +++ b/modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go @@ -125,12 +125,12 @@ func parsePHPFastCGI(h httpcaddyfile.Helper) ([]httpcaddyfile.ConfigValue, error redirMatcherSet := caddy.ModuleMap{ "file": h.JSON(fileserver.MatchFile{ TryFiles: []string{"{http.request.uri.path}/index.php"}, - }, nil), + }), "not": h.JSON(caddyhttp.MatchNegate{ MatchersRaw: caddy.ModuleMap{ - "path": h.JSON(caddyhttp.MatchPath{"*/"}, nil), + "path": h.JSON(caddyhttp.MatchPath{"*/"}), }, - }, nil), + }), } redirHandler := caddyhttp.StaticResponse{ StatusCode: caddyhttp.WeakString("308"), @@ -145,7 +145,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"}, - }, nil), + }), } rewriteHandler := rewrite.Rewrite{ URI: "{http.matchers.file.relative}{http.request.uri.query_string}", @@ -159,7 +159,7 @@ func parsePHPFastCGI(h httpcaddyfile.Helper) ([]httpcaddyfile.ConfigValue, error // route to actually reverse proxy requests to PHP files; // match only requests that are for PHP files rpMatcherSet := caddy.ModuleMap{ - "path": h.JSON([]string{"*.php"}, nil), + "path": h.JSON([]string{"*.php"}), } // if the user specified a matcher token, use that |