Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

Commit

Permalink
Merge pull request #1743 from vyshane/nginx-ingress-controller-proxy-…
Browse files Browse the repository at this point in the history
…buffer-size-2

Automatic merge from submit-queue

Allow customisation of the nginx proxy_buffer_size directive via ConfigMap

I'm opening a new PR with the same changes as #1693 because I pushed the latter with an email address that can't be used to sign the CLA. Description from the previous PR:

When using nginx as a proxy we can run into the following error:

```
upstream sent too big header while reading response header from upstream
```

In order to fix this, we need to be able to configure the proxy_buffer_size nginx directive to increase its value. This PR updates the nginx-ingress-controller to allow that.
  • Loading branch information
Kubernetes Submit Queue authored Sep 15, 2016
2 parents 068ea30 + 5db386b commit 3cfb5e1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ingress/controllers/nginx/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
1 change: 1 addition & 0 deletions ingress/controllers/nginx/nginx.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ http {

proxy_redirect off;
proxy_buffering off;
proxy_buffer_size {{ $cfg.proxyBufferSize }};

proxy_http_version 1.1;

Expand Down
6 changes: 6 additions & 0 deletions ingress/controllers/nginx/nginx/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -275,6 +280,7 @@ func NewDefault() Configuration {
ProxyRealIPCIDR: defIPCIDR,
ProxyReadTimeout: 60,
ProxySendTimeout: 60,
ProxyBufferSize: "4k",
ServerNameHashMaxSize: 512,
ServerNameHashBucketSize: 64,
SSLRedirect: true,
Expand Down

0 comments on commit 3cfb5e1

Please sign in to comment.