add support for http2-max-requests in configmap

This commit is contained in:
Derek Perkins 2018-09-02 23:53:30 -06:00
parent a92555f4cb
commit 9099f3b4db
3 changed files with 16 additions and 0 deletions

View file

@ -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"| |[error-log-level](#error-log-level)|string|"notice"|
|[http2-max-field-size](#http2-max-field-size)|string|"4k"| |[http2-max-field-size](#http2-max-field-size)|string|"4k"|
|[http2-max-header-size](#http2-max-header-size)|string|"16k"| |[http2-max-header-size](#http2-max-header-size)|string|"16k"|
|[http2-max-requests](#http2-max-requests)|int|1000|
|[hsts](#hsts)|bool|"true"| |[hsts](#hsts)|bool|"true"|
|[hsts-include-subdomains](#hsts-include-subdomains)|bool|"true"| |[hsts-include-subdomains](#hsts-include-subdomains)|bool|"true"|
|[hsts-max-age](#hsts-max-age)|string|"15724800"| |[hsts-max-age](#hsts-max-age)|string|"15724800"|
@ -267,6 +268,13 @@ Limits the maximum size of the entire request header list after HPACK decompress
_References:_ _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) [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 ## hsts
Enables or disables the header HSTS in servers running SSL. Enables or disables the header HSTS in servers running SSL.

View file

@ -178,6 +178,12 @@ type Configuration struct {
// HTTP2MaxHeaderSize Limits the maximum size of the entire request header list after HPACK decompression // HTTP2MaxHeaderSize Limits the maximum size of the entire request header list after HPACK decompression
HTTP2MaxHeaderSize string `json:"http2-max-header-size,omitempty"` 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 // Enables or disables the header HSTS in servers running SSL
HSTS bool `json:"hsts,omitempty"` HSTS bool `json:"hsts,omitempty"`
@ -562,6 +568,7 @@ func NewDefault() Configuration {
GenerateRequestId: true, GenerateRequestId: true,
HTTP2MaxFieldSize: "4k", HTTP2MaxFieldSize: "4k",
HTTP2MaxHeaderSize: "16k", HTTP2MaxHeaderSize: "16k",
HTTP2MaxRequests: 1000,
HTTPRedirectCode: 308, HTTPRedirectCode: 308,
HSTS: true, HSTS: true,
HSTSIncludeSubdomains: true, HSTSIncludeSubdomains: true,

View file

@ -155,6 +155,7 @@ http {
http2_max_field_size {{ $cfg.HTTP2MaxFieldSize }}; http2_max_field_size {{ $cfg.HTTP2MaxFieldSize }};
http2_max_header_size {{ $cfg.HTTP2MaxHeaderSize }}; http2_max_header_size {{ $cfg.HTTP2MaxHeaderSize }};
http2_max_requests {{ $cfg.HTTP2MaxRequests }};
types_hash_max_size 2048; types_hash_max_size 2048;
server_names_hash_max_size {{ $cfg.ServerNameHashMaxSize }}; server_names_hash_max_size {{ $cfg.ServerNameHashMaxSize }};