diff options
author | Matthew Holt <mholt@users.noreply.github.com> | 2019-11-27 11:51:32 -0700 |
---|---|---|
committer | Matthew Holt <mholt@users.noreply.github.com> | 2019-11-27 11:51:32 -0700 |
commit | db4293cb5fce33b467b50ef77698f69a4a066215 (patch) | |
tree | d05ec08e4d191667de09064b77629ec9acfab729 /modules/caddyhttp/reverseproxy | |
parent | 6e10586303fd90f0298c8086e754b35dfc3f01ba (diff) |
reverse_proxy: Add flush_interval to caddyfile syntax (#1460)
Also add godoc for Caddyfile syntax for file_server
Diffstat (limited to 'modules/caddyhttp/reverseproxy')
-rw-r--r-- | modules/caddyhttp/reverseproxy/caddyfile.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/caddyhttp/reverseproxy/caddyfile.go b/modules/caddyhttp/reverseproxy/caddyfile.go index 6b1ec69..c8cf26e 100644 --- a/modules/caddyhttp/reverseproxy/caddyfile.go +++ b/modules/caddyhttp/reverseproxy/caddyfile.go @@ -68,6 +68,9 @@ func parseCaddyfile(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHandler, error) // unhealthy_status <status> // unhealthy_latency <duration> // +// # streaming +// flush_interval <duration> +// // # header manipulation // header_up [+|-]<field> [<value|regexp> [<replacement>]] // header_down [+|-]<field> [<value|regexp> [<replacement>]] @@ -328,6 +331,16 @@ func (h *Handler) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { } h.HealthChecks.Passive.UnhealthyLatency = caddy.Duration(dur) + case "flush_interval": + if !d.NextArg() { + return d.ArgErr() + } + dur, err := time.ParseDuration(d.Val()) + if err != nil { + return d.Errf("bad duration value '%s': %v", d.Val(), err) + } + h.FlushInterval = caddy.Duration(dur) + case "header_up": if h.Headers == nil { h.Headers = new(headers.Handler) |