Enable configuration to disable http2

This commit is contained in:
Manuel de Brito Fontes 2016-05-12 07:48:37 -03:00
parent 23d16a4451
commit 2d7acf33c4
2 changed files with 7 additions and 1 deletions

View file

@ -154,7 +154,7 @@ http {
{{ range $server := .servers }} {{ range $server := .servers }}
server { server {
listen 80{{ if $cfg.useProxyProtocol }} proxy_protocol{{ end }}; 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 */}} {{/* comment PEM sha is required to detect changes in the generated configuration and force a reload */}}
# PEM sha: {{ $server.SSLPemChecksum }} # PEM sha: {{ $server.SSLPemChecksum }}
ssl_certificate {{ $server.SSLCertificate }}; ssl_certificate {{ $server.SSLCertificate }};

View file

@ -214,6 +214,11 @@ type nginxConfiguration struct {
// http://nginx.org/en/docs/http/ngx_http_gzip_module.html // http://nginx.org/en/docs/http/ngx_http_gzip_module.html
UseGzip bool `structs:"use-gzip,omitempty"` 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. // 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 // Responses with the “text/html” type are always compressed if UseGzip is enabled
GzipTypes string `structs:"gzip-types,omitempty"` GzipTypes string `structs:"gzip-types,omitempty"`
@ -270,6 +275,7 @@ func newDefaultNginxCfg() nginxConfiguration {
UseGzip: true, UseGzip: true,
WorkerProcesses: strconv.Itoa(runtime.NumCPU()), WorkerProcesses: strconv.Itoa(runtime.NumCPU()),
VtsStatusZoneSize: "10m", VtsStatusZoneSize: "10m",
UseHTTP2: true,
} }
if glog.V(5) { if glog.V(5) {