From 1d00a5c2bc5e2f927dceffe1e231c4adc9a5f90b Mon Sep 17 00:00:00 2001 From: Manuel de Brito Fontes Date: Sat, 4 Aug 2018 17:43:34 -0400 Subject: [PATCH] Enable reuse-port by default --- docs/user-guide/nginx-configuration/configmap.md | 8 +++++++- internal/ingress/controller/config/config.go | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/user-guide/nginx-configuration/configmap.md b/docs/user-guide/nginx-configuration/configmap.md index 80386e96bf..f6c020d281 100644 --- a/docs/user-guide/nginx-configuration/configmap.md +++ b/docs/user-guide/nginx-configuration/configmap.md @@ -68,6 +68,7 @@ The following table shows a configuration option's name, type, and the default v |[server-name-hash-bucket-size](#server-name-hash-bucket-size)|int|`` |[proxy-headers-hash-max-size](#proxy-headers-hash-max-size)|int|512| |[proxy-headers-hash-bucket-size](#proxy-headers-hash-bucket-size)|int|64| +|[reuse-port](#reuse-port)|bool|"true"| |[server-tokens](#server-tokens)|bool|"true"| |[ssl-ciphers](#ssl-ciphers)|string|"ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256"| |[ssl-ecdh-curve](#ssl-ecdh-curve)|string|"auto"| @@ -373,7 +374,12 @@ _References:_ - [http://nginx.org/en/docs/hash.html](http://nginx.org/en/docs/hash.html) - [https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_headers_hash_max_size](https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_headers_hash_max_size) -## proxy-headers-hash-bucket-size +## reuse-port + +Instructs NGINX to create an individual listening socket for each worker process (using the SO_REUSEPORT socket option), allowing a kernel to distribute incoming connections between worker processes +_**default:**_ true + +## proxy-headers-hash-bucket-size Sets the size of the bucket for the proxy headers hash tables. diff --git a/internal/ingress/controller/config/config.go b/internal/ingress/controller/config/config.go index 7ff7a32055..552627d0b5 100644 --- a/internal/ingress/controller/config/config.go +++ b/internal/ingress/controller/config/config.go @@ -479,8 +479,7 @@ type Configuration struct { // ReusePort instructs NGINX to create an individual listening socket for // each worker process (using the SO_REUSEPORT socket option), allowing a // kernel to distribute incoming connections between worker processes - // Default: false - // Reason for the default: https://trac.nginx.org/nginx/ticket/1300 + // Default: true ReusePort bool `json:"reuse-port"` // HideHeaders sets additional header that will not be passed from the upstream @@ -577,6 +576,7 @@ func NewDefault() Configuration { ProxyHeadersHashMaxSize: 512, ProxyHeadersHashBucketSize: 64, ProxyStreamResponses: 1, + ReusePort: true, ShowServerTokens: true, SSLBufferSize: sslBufferSize, SSLCiphers: sslCiphers,