summary refs log tree commit diff
path: root/nixos/modules/services/web-servers/nginx/vhost-options.nix
diff options
context:
space:
mode:
authorNiklas Hambüchen <mail@nh2.me>2017-12-19 19:53:02 +0100
committerNiklas Hambüchen <mail@nh2.me>2017-12-19 19:59:15 +0100
commitafa97cb981c5de4cb68631b911e1de32aa83dcf7 (patch)
treea822a9bae082c31856478180baeacf934896e283 /nixos/modules/services/web-servers/nginx/vhost-options.nix
parentd045d6250017af7e51bea494082cc564f063ef87 (diff)
downloadnixpkgs-afa97cb981c5de4cb68631b911e1de32aa83dcf7.tar
nixpkgs-afa97cb981c5de4cb68631b911e1de32aa83dcf7.tar.gz
nixpkgs-afa97cb981c5de4cb68631b911e1de32aa83dcf7.tar.bz2
nixpkgs-afa97cb981c5de4cb68631b911e1de32aa83dcf7.tar.lz
nixpkgs-afa97cb981c5de4cb68631b911e1de32aa83dcf7.tar.xz
nixpkgs-afa97cb981c5de4cb68631b911e1de32aa83dcf7.tar.zst
nixpkgs-afa97cb981c5de4cb68631b911e1de32aa83dcf7.zip
nginx service: Make http2 an option.
HTTP 2 can break some things, for example due to this Chrome bug:

  https://bugs.chromium.org/p/chromium/issues/detail?id=796199

So the service hardcoding it to be enabled is not helpful.

This commit adds an option so you can turn it off.
Diffstat (limited to 'nixos/modules/services/web-servers/nginx/vhost-options.nix')
-rw-r--r--nixos/modules/services/web-servers/nginx/vhost-options.nix14
1 files changed, 14 insertions, 0 deletions
diff --git a/nixos/modules/services/web-servers/nginx/vhost-options.nix b/nixos/modules/services/web-servers/nginx/vhost-options.nix
index 801601aafd9..29f08cc4f30 100644
--- a/nixos/modules/services/web-servers/nginx/vhost-options.nix
+++ b/nixos/modules/services/web-servers/nginx/vhost-options.nix
@@ -114,6 +114,20 @@ with lib;
       description = "Path to server SSL certificate key.";
     };
 
+    http2 = mkOption {
+      type = types.bool;
+      default = true;
+      description = ''
+        Whether to enable HTTP 2.
+        Note that (as of writing) due to nginx's implementation, to disable
+        HTTP 2 you have to disable it on all vhosts that use a given
+        IP address / port.
+        If there is one server block configured to enable http2,then it is
+        enabled for all server blocks on this IP.
+        See https://stackoverflow.com/a/39466948/263061.
+      '';
+    };
+
     root = mkOption {
       type = types.nullOr types.path;
       default = null;