1
0
mirror of https://github.com/nginx-proxy/nginx-proxy synced 2024-11-08 07:49:22 +01:00

feat: optionally disable HTTP/2

This commit is contained in:
Nicolas Duchon 2023-07-18 22:32:50 +02:00
parent 7ca3769a39
commit 5af973b193
No known key found for this signature in database
GPG Key ID: EA3151C66A4D79E7

@ -471,6 +471,7 @@ server {
{{- $containers := $vhost.containers }}
{{- $default_server := when $vhost.default "default_server" "" }}
{{- $https_method := $vhost.https_method }}
{{- $http2 := parseBool (or (first (keys (groupByLabel $containers "com.github.nginx-proxy.nginx-proxy.http2.enable"))) $globals.Env.ENABLE_HTTP2 "true")}}
{{- $is_regexp := hasPrefix "~" $host }}
{{- $upstream_name := when (or $is_regexp $globals.sha1_upstream_name) (sha1 $host) $host }}
@ -549,7 +550,9 @@ server {
{{- if $server_tokens }}
server_tokens {{ $server_tokens }};
{{- end }}
{{- if $http2 }}
http2 on;
{{- end }}
{{ $globals.access_log }}
{{- if or (eq $https_method "nohttps") (not $cert_ok) (eq $https_method "noredirect") }}
listen {{ $globals.external_http_port }} {{ $default_server }};