summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/reverseproxy
diff options
context:
space:
mode:
authorFrancis Lavoie <lavofr@gmail.com>2020-06-22 13:45:18 -0400
committerGitHub <noreply@github.com>2020-06-22 11:45:18 -0600
commitb1480eb52f8e3dd621798e2b74b4e3e47bacc9f5 (patch)
treeeaa43840a77c376e58ba804e8c64fdee331d1e3e /modules/caddyhttp/reverseproxy
parent5bc4777be9c818ab6b86448423a7ba29820e71b8 (diff)
fastcgi: Fix php_fastcgi matcher regression (#3512)
Diffstat (limited to 'modules/caddyhttp/reverseproxy')
-rw-r--r--modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go b/modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go
index 7c06adc..03b7226 100644
--- a/modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go
+++ b/modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go
@@ -132,6 +132,16 @@ func parsePHPFastCGI(h httpcaddyfile.Helper) ([]httpcaddyfile.ConfigValue, error
// set the default index file for the try_files rewrites
indexFile := "index.php"
+ // if the user specified a matcher token, use that
+ // matcher in a route that wraps both of our routes;
+ // either way, strip the matcher token and pass
+ // the remaining tokens to the unmarshaler so that
+ // we can gain the rest of the reverse_proxy syntax
+ userMatcherSet, err := h.ExtractMatcherSet()
+ if err != nil {
+ return nil, err
+ }
+
// make a new dispenser from the remaining tokens so that we
// can reset the dispenser back to this point for the
// reverse_proxy unmarshaler to read from it as well
@@ -252,16 +262,6 @@ func parsePHPFastCGI(h httpcaddyfile.Helper) ([]httpcaddyfile.ConfigValue, error
"path": h.JSON(pathList),
}
- // if the user specified a matcher token, use that
- // matcher in a route that wraps both of our routes;
- // either way, strip the matcher token and pass
- // the remaining tokens to the unmarshaler so that
- // we can gain the rest of the reverse_proxy syntax
- userMatcherSet, err := h.ExtractMatcherSet()
- if err != nil {
- return nil, err
- }
-
// create the reverse proxy handler which uses our FastCGI transport
rpHandler := &reverseproxy.Handler{
TransportRaw: caddyconfig.JSONModuleObject(fcgiTransport, "protocol", "fastcgi", nil),