Add support for custom header sizes
This commit is contained in:
parent
6cd20734c6
commit
87322b84ba
2 changed files with 16 additions and 0 deletions
|
@ -83,6 +83,11 @@ type Configuration struct {
|
||||||
// By default this is enabled
|
// By default this is enabled
|
||||||
EnableDynamicTLSRecords bool `json:"enable-dynamic-tls-records"`
|
EnableDynamicTLSRecords bool `json:"enable-dynamic-tls-records"`
|
||||||
|
|
||||||
|
// ClientHeaderBufferSize allows to configure a custom buffer
|
||||||
|
// size for reading client request header
|
||||||
|
// http://nginx.org/en/docs/http/ngx_http_core_module.html#client_header_buffer_size
|
||||||
|
ClientHeaderBufferSize string `json:"client-header-buffer-size"`
|
||||||
|
|
||||||
// EnableSPDY enables spdy and use ALPN and NPN to advertise the availability of the two protocols
|
// EnableSPDY enables spdy and use ALPN and NPN to advertise the availability of the two protocols
|
||||||
// https://blog.cloudflare.com/open-sourcing-our-nginx-http-2-spdy-code
|
// https://blog.cloudflare.com/open-sourcing-our-nginx-http-2-spdy-code
|
||||||
// By default this is enabled
|
// By default this is enabled
|
||||||
|
@ -128,6 +133,12 @@ type Configuration struct {
|
||||||
// http://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_timeout
|
// http://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_timeout
|
||||||
KeepAlive int `json:"keep-alive,omitempty"`
|
KeepAlive int `json:"keep-alive,omitempty"`
|
||||||
|
|
||||||
|
// LargeClientHeaderBuffers Sets the maximum number and size of buffers used for reading
|
||||||
|
// large client request header.
|
||||||
|
// http://nginx.org/en/docs/http/ngx_http_core_module.html#large_client_header_buffers
|
||||||
|
// Default: 4 8k
|
||||||
|
LargeClientHeaderBuffers string `json:"large-client-header-buffers"`
|
||||||
|
|
||||||
// Maximum number of simultaneous connections that can be opened by each worker process
|
// Maximum number of simultaneous connections that can be opened by each worker process
|
||||||
// http://nginx.org/en/docs/ngx_core_module.html#worker_connections
|
// http://nginx.org/en/docs/ngx_core_module.html#worker_connections
|
||||||
MaxWorkerConnections int `json:"max-worker-connections,omitempty"`
|
MaxWorkerConnections int `json:"max-worker-connections,omitempty"`
|
||||||
|
@ -221,6 +232,7 @@ type Configuration struct {
|
||||||
// NewDefault returns the default nginx configuration
|
// NewDefault returns the default nginx configuration
|
||||||
func NewDefault() Configuration {
|
func NewDefault() Configuration {
|
||||||
cfg := Configuration{
|
cfg := Configuration{
|
||||||
|
ClientHeaderBufferSize: "1k",
|
||||||
EnableDynamicTLSRecords: true,
|
EnableDynamicTLSRecords: true,
|
||||||
EnableSPDY: false,
|
EnableSPDY: false,
|
||||||
ErrorLogLevel: errorLevel,
|
ErrorLogLevel: errorLevel,
|
||||||
|
@ -229,6 +241,7 @@ func NewDefault() Configuration {
|
||||||
HSTSMaxAge: hstsMaxAge,
|
HSTSMaxAge: hstsMaxAge,
|
||||||
GzipTypes: gzipTypes,
|
GzipTypes: gzipTypes,
|
||||||
KeepAlive: 75,
|
KeepAlive: 75,
|
||||||
|
LargeClientHeaderBuffers: "4 8k",
|
||||||
MaxWorkerConnections: 16384,
|
MaxWorkerConnections: 16384,
|
||||||
MapHashBucketSize: 64,
|
MapHashBucketSize: 64,
|
||||||
ProxyRealIPCIDR: defIPCIDR,
|
ProxyRealIPCIDR: defIPCIDR,
|
||||||
|
|
|
@ -54,6 +54,9 @@ http {
|
||||||
|
|
||||||
keepalive_timeout {{ $cfg.KeepAlive }}s;
|
keepalive_timeout {{ $cfg.KeepAlive }}s;
|
||||||
|
|
||||||
|
client_header_buffer_size {{ $cfg.ClientHeaderBufferSize }};
|
||||||
|
large_client_header_buffers {{ $cfg.LargeClientHeaderBuffers }};
|
||||||
|
|
||||||
types_hash_max_size 2048;
|
types_hash_max_size 2048;
|
||||||
server_names_hash_max_size {{ $cfg.ServerNameHashMaxSize }};
|
server_names_hash_max_size {{ $cfg.ServerNameHashMaxSize }};
|
||||||
server_names_hash_bucket_size {{ $cfg.ServerNameHashBucketSize }};
|
server_names_hash_bucket_size {{ $cfg.ServerNameHashBucketSize }};
|
||||||
|
|
Loading…
Reference in a new issue