From 2d7acf33c469cd72becab16bbfa0bbc4916325a7 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 --- controllers/nginx/nginx.tmpl | 2 +- controllers/nginx/nginx/main.go | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/controllers/nginx/nginx.tmpl b/controllers/nginx/nginx.tmpl index bb85c7874..a57b770a0 100644 --- a/controllers/nginx/nginx.tmpl +++ b/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/controllers/nginx/nginx/main.go b/controllers/nginx/nginx/main.go index 5c7d5a526..9c474cf87 100644 --- a/controllers/nginx/nginx/main.go +++ b/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) {