Allow customisation of the nginx proxy_buffer_size directive via ConfigMap

This commit is contained in:
Vy-Shane Xie 2016-09-15 23:14:16 +08:00
parent fbff29d1ec
commit ae1c4503b3
3 changed files with 10 additions and 0 deletions

View file

@ -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-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 **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

View file

@ -252,6 +252,7 @@ http {
proxy_redirect off; proxy_redirect off;
proxy_buffering off; proxy_buffering off;
proxy_buffer_size {{ $cfg.proxyBufferSize }};
proxy_http_version 1.1; proxy_http_version 1.1;

View file

@ -157,6 +157,11 @@ type Configuration struct {
// http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_send_timeout // http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_send_timeout
ProxySendTimeout int `structs:"proxy-send-timeout,omitempty"` 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 // Configures name servers used to resolve names of upstream servers into addresses
// http://nginx.org/en/docs/http/ngx_http_core_module.html#resolver // http://nginx.org/en/docs/http/ngx_http_core_module.html#resolver
Resolver string `structs:"resolver,omitempty"` Resolver string `structs:"resolver,omitempty"`
@ -275,6 +280,7 @@ func NewDefault() Configuration {
ProxyRealIPCIDR: defIPCIDR, ProxyRealIPCIDR: defIPCIDR,
ProxyReadTimeout: 60, ProxyReadTimeout: 60,
ProxySendTimeout: 60, ProxySendTimeout: 60,
ProxyBufferSize: "4k",
ServerNameHashMaxSize: 512, ServerNameHashMaxSize: 512,
ServerNameHashBucketSize: 64, ServerNameHashBucketSize: 64,
SSLRedirect: true, SSLRedirect: true,