From 54848a17dcd70f32243e3c668d718f8f7475ab74 Mon Sep 17 00:00:00 2001 From: Manuel de Brito Fontes Date: Thu, 12 May 2016 07:48:37 -0300 Subject: [PATCH] Enable configuration to disable http2 --- ingress/controllers/nginx/nginx.tmpl | 2 +- ingress/controllers/nginx/nginx/main.go | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ingress/controllers/nginx/nginx.tmpl b/ingress/controllers/nginx/nginx.tmpl index bb85c78745..a57b770a00 100644 --- a/ingress/controllers/nginx/nginx.tmpl +++ b/ingress/controllers/nginx/nginx.tmpl @@ -154,7 +154,7 @@ http { {{ range $server := .servers }} server { listen 80{{ if $cfg.useProxyProtocol }} proxy_protocol{{ end }}; - {{ if $server.SSL }}listen 443{{ if $cfg.useProxyProtocol }} proxy_protocol{{ end }} ssl http2; + {{ if $server.SSL }}listen 443 {{ if $cfg.useProxyProtocol }}proxy_protocol{{ end }} ssl {{ if $cfg.useHttp2 }}http2{{ end }}; {{/* comment PEM sha is required to detect changes in the generated configuration and force a reload */}} # PEM sha: {{ $server.SSLPemChecksum }} ssl_certificate {{ $server.SSLCertificate }}; diff --git a/ingress/controllers/nginx/nginx/main.go b/ingress/controllers/nginx/nginx/main.go index 5c7d5a5264..9c474cf87c 100644 --- a/ingress/controllers/nginx/nginx/main.go +++ b/ingress/controllers/nginx/nginx/main.go @@ -214,6 +214,11 @@ type nginxConfiguration struct { // http://nginx.org/en/docs/http/ngx_http_gzip_module.html UseGzip bool `structs:"use-gzip,omitempty"` + // Enables or disables the HTTP/2 support in secure connections + // http://nginx.org/en/docs/http/ngx_http_v2_module.html + // Default: true + UseHTTP2 bool `structs:"use-http2,omitempty"` + // MIME types in addition to "text/html" to compress. The special value “*” matches any MIME type. // Responses with the “text/html” type are always compressed if UseGzip is enabled GzipTypes string `structs:"gzip-types,omitempty"` @@ -270,6 +275,7 @@ func newDefaultNginxCfg() nginxConfiguration { UseGzip: true, WorkerProcesses: strconv.Itoa(runtime.NumCPU()), VtsStatusZoneSize: "10m", + UseHTTP2: true, } if glog.V(5) {