diff options
Diffstat (limited to 'modules/caddyhttp/reverseproxy/fastcgi')
-rw-r--r-- | modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go b/modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go index 1476d60..fd82c5a 100644 --- a/modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go +++ b/modules/caddyhttp/reverseproxy/fastcgi/caddyfile.go @@ -39,32 +39,34 @@ func init() { // } // func (t *Transport) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { - for d.NextBlock() { - switch d.Val() { - case "root": - if !d.NextArg() { - return d.ArgErr() + for d.Next() { + for d.NextBlock(0) { + switch d.Val() { + case "root": + if !d.NextArg() { + return d.ArgErr() + } + t.Root = d.Val() + + case "split": + if !d.NextArg() { + return d.ArgErr() + } + t.SplitPath = d.Val() + + case "env": + args := d.RemainingArgs() + if len(args) != 2 { + return d.ArgErr() + } + if t.EnvVars == nil { + t.EnvVars = make(map[string]string) + } + t.EnvVars[args[0]] = args[1] + + default: + return d.Errf("unrecognized subdirective %s", d.Val()) } - t.Root = d.Val() - - case "split": - if !d.NextArg() { - return d.ArgErr() - } - t.SplitPath = d.Val() - - case "env": - args := d.RemainingArgs() - if len(args) != 2 { - return d.ArgErr() - } - if t.EnvVars == nil { - t.EnvVars = make(map[string]string) - } - t.EnvVars[args[0]] = args[1] - - default: - return d.Errf("unrecognized subdirective %s", d.Val()) } } return nil |