Merge pull request #32858 from nh2/nginx-add-http2-option

nginx service: Make http2 an option.

authored by Franz Pletz and committed by GitHub cf12bc44 9c5fedc2

+16 -1
+2 -1
nixos/modules/services/web-servers/nginx/default.nix
··· 167 168 listenString = { addr, port, ssl, ... }: 169 "listen ${addr}:${toString port} " 170 - + optionalString ssl "ssl http2 " 171 + optionalString vhost.default "default_server " 172 + ";"; 173
··· 167 168 listenString = { addr, port, ssl, ... }: 169 "listen ${addr}:${toString port} " 170 + + optionalString ssl "ssl " 171 + + optionalString vhost.http2 "http2 " 172 + optionalString vhost.default "default_server " 173 + ";"; 174
+14
nixos/modules/services/web-servers/nginx/vhost-options.nix
··· 114 description = "Path to server SSL certificate key."; 115 }; 116 117 root = mkOption { 118 type = types.nullOr types.path; 119 default = null;
··· 114 description = "Path to server SSL certificate key."; 115 }; 116 117 + http2 = mkOption { 118 + type = types.bool; 119 + default = true; 120 + description = '' 121 + Whether to enable HTTP 2. 122 + Note that (as of writing) due to nginx's implementation, to disable 123 + HTTP 2 you have to disable it on all vhosts that use a given 124 + IP address / port. 125 + If there is one server block configured to enable http2,then it is 126 + enabled for all server blocks on this IP. 127 + See https://stackoverflow.com/a/39466948/263061. 128 + ''; 129 + }; 130 + 131 root = mkOption { 132 type = types.nullOr types.path; 133 default = null;