diff --git a/controllers/nginx/configuration.md b/controllers/nginx/configuration.md index 0716b27e5..a521ce8ec 100644 --- a/controllers/nginx/configuration.md +++ b/controllers/nginx/configuration.md @@ -198,6 +198,9 @@ http://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_timeout **proxy-send-timeout:** Sets the timeout in seconds for [transmitting a request to the proxied server](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_send_timeout). The timeout is set only between two successive write operations, not for the transmission of the whole request. +**proxy-buffer-size:** Sets the size of the buffer used for [reading the first part of the response](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffer_size) received from the proxied server. This part usually contains a small response header.` + + **resolver:** Configures name servers used to [resolve](http://nginx.org/en/docs/http/ngx_http_core_module.html#resolver) names of upstream servers into addresses diff --git a/controllers/nginx/nginx.tmpl b/controllers/nginx/nginx.tmpl index fb1ca360c..f88d559fc 100644 --- a/controllers/nginx/nginx.tmpl +++ b/controllers/nginx/nginx.tmpl @@ -252,6 +252,7 @@ http { proxy_redirect off; proxy_buffering off; + proxy_buffer_size {{ $cfg.proxyBufferSize }}; proxy_http_version 1.1; diff --git a/controllers/nginx/nginx/config/config.go b/controllers/nginx/nginx/config/config.go index 684c55d91..cd4927d4e 100644 --- a/controllers/nginx/nginx/config/config.go +++ b/controllers/nginx/nginx/config/config.go @@ -157,6 +157,11 @@ type Configuration struct { // http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_send_timeout ProxySendTimeout int `structs:"proxy-send-timeout,omitempty"` + // Sets the size of the buffer used for reading the first part of the response received from the + // proxied server. This part usually contains a small response header. + // http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffer_size) + ProxyBufferSize string `structs:"proxy-buffer-size,omitempty"` + // Configures name servers used to resolve names of upstream servers into addresses // http://nginx.org/en/docs/http/ngx_http_core_module.html#resolver Resolver string `structs:"resolver,omitempty"` @@ -275,6 +280,7 @@ func NewDefault() Configuration { ProxyRealIPCIDR: defIPCIDR, ProxyReadTimeout: 60, ProxySendTimeout: 60, + ProxyBufferSize: "4k", ServerNameHashMaxSize: 512, ServerNameHashBucketSize: 64, SSLRedirect: true,