Skip to content

Commit

Permalink
Merge pull request kubernetes#3029 from derekperkins/http2-max-requests
Browse files Browse the repository at this point in the history
add support for http2-max-requests in configmap
  • Loading branch information
k8s-ci-robot committed Sep 3, 2018
2 parents a92555f + 9099f3b commit 9f14c9a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/user-guide/nginx-configuration/configmap.md
Expand Up @@ -48,6 +48,7 @@ The following table shows a configuration option's name, type, and the default v
|[error-log-level](#error-log-level)|string|"notice"|
|[http2-max-field-size](#http2-max-field-size)|string|"4k"|
|[http2-max-header-size](#http2-max-header-size)|string|"16k"|
|[http2-max-requests](#http2-max-requests)|int|1000|
|[hsts](#hsts)|bool|"true"|
|[hsts-include-subdomains](#hsts-include-subdomains)|bool|"true"|
|[hsts-max-age](#hsts-max-age)|string|"15724800"|
Expand Down Expand Up @@ -267,6 +268,13 @@ Limits the maximum size of the entire request header list after HPACK decompress
_References:_
[https://nginx.org/en/docs/http/ngx_http_v2_module.html#http2_max_header_size](https://nginx.org/en/docs/http/ngx_http_v2_module.html#http2_max_header_size)

## http2-max-requests

Sets the maximum number of requests (including push requests) that can be served through one HTTP/2 connection, after which the next client request will lead to connection closing and the need of establishing a new connection.

_References:_
[http://nginx.org/en/docs/http/ngx_http_v2_module.html#http2_max_requests](http://nginx.org/en/docs/http/ngx_http_v2_module.html#http2_max_requests)

## hsts

Enables or disables the header HSTS in servers running SSL.
Expand Down
7 changes: 7 additions & 0 deletions internal/ingress/controller/config/config.go
Expand Up @@ -178,6 +178,12 @@ type Configuration struct {
// HTTP2MaxHeaderSize Limits the maximum size of the entire request header list after HPACK decompression
HTTP2MaxHeaderSize string `json:"http2-max-header-size,omitempty"`

// http://nginx.org/en/docs/http/ngx_http_v2_module.html#http2_max_requests
// HTTP2MaxRequests Sets the maximum number of requests (including push requests) that can be served
// through one HTTP/2 connection, after which the next client request will lead to connection closing
// and the need of establishing a new connection.
HTTP2MaxRequests int `json:"http2-max-requests,omitempty"`

// Enables or disables the header HSTS in servers running SSL
HSTS bool `json:"hsts,omitempty"`

Expand Down Expand Up @@ -562,6 +568,7 @@ func NewDefault() Configuration {
GenerateRequestId: true,
HTTP2MaxFieldSize: "4k",
HTTP2MaxHeaderSize: "16k",
HTTP2MaxRequests: 1000,
HTTPRedirectCode: 308,
HSTS: true,
HSTSIncludeSubdomains: true,
Expand Down
1 change: 1 addition & 0 deletions rootfs/etc/nginx/template/nginx.tmpl
Expand Up @@ -155,6 +155,7 @@ http {

http2_max_field_size {{ $cfg.HTTP2MaxFieldSize }};
http2_max_header_size {{ $cfg.HTTP2MaxHeaderSize }};
http2_max_requests {{ $cfg.HTTP2MaxRequests }};

types_hash_max_size 2048;
server_names_hash_max_size {{ $cfg.ServerNameHashMaxSize }};
Expand Down

0 comments on commit 9f14c9a

Please sign in to comment.