summary refs log tree commit diff
path: root/nixos/modules/services/web-servers
diff options
context:
space:
mode:
authorIzorkin <izorkin@elven.pw>2023-07-28 18:13:37 +0300
committerIzorkin <izorkin@elven.pw>2023-08-03 07:09:02 +0300
commitcf7cea328785316ed428cb1036169072cedf7a89 (patch)
tree62b2b41a7649a356e2153564e539d07249720d06 /nixos/modules/services/web-servers
parentf1f450ab722ee5ca0ce6888ca4a8ac49a1a1fecf (diff)
downloadnixpkgs-cf7cea328785316ed428cb1036169072cedf7a89.tar
nixpkgs-cf7cea328785316ed428cb1036169072cedf7a89.tar.gz
nixpkgs-cf7cea328785316ed428cb1036169072cedf7a89.tar.bz2
nixpkgs-cf7cea328785316ed428cb1036169072cedf7a89.tar.lz
nixpkgs-cf7cea328785316ed428cb1036169072cedf7a89.tar.xz
nixpkgs-cf7cea328785316ed428cb1036169072cedf7a89.tar.zst
nixpkgs-cf7cea328785316ed428cb1036169072cedf7a89.zip
nixos/nginx: using new variant of http2 directive
Diffstat (limited to 'nixos/modules/services/web-servers')
-rw-r--r--nixos/modules/services/web-servers/nginx/default.nix7
1 files changed, 6 insertions, 1 deletions
diff --git a/nixos/modules/services/web-servers/nginx/default.nix b/nixos/modules/services/web-servers/nginx/default.nix
index 7e5d2aa964a..fccc31b5116 100644
--- a/nixos/modules/services/web-servers/nginx/default.nix
+++ b/nixos/modules/services/web-servers/nginx/default.nix
@@ -335,7 +335,7 @@ let
           + ";"))
           + "
             listen ${addr}:${toString port} "
-          + optionalString (ssl && vhost.http2) "http2 "
+          + optionalString (ssl && vhost.http2 && oldHTTP2) "http2 "
           + optionalString ssl "ssl "
           + optionalString vhost.default "default_server "
           + optionalString vhost.reuseport "reuseport "
@@ -380,6 +380,9 @@ let
         server {
           ${concatMapStringsSep "\n" listenString hostListen}
           server_name ${vhost.serverName} ${concatStringsSep " " vhost.serverAliases};
+          ${optionalString (hasSSL && vhost.http2 && !oldHTTP2) ''
+            http2 on;
+          ''}
           ${optionalString (hasSSL && vhost.quic) ''
             http3 ${if vhost.http3 then "on" else "off"};
             http3_hq ${if vhost.http3_hq then "on" else "off"};
@@ -463,6 +466,8 @@ let
   );
 
   mkCertOwnershipAssertion = import ../../../security/acme/mk-cert-ownership-assertion.nix;
+
+  oldHTTP2 = versionOlder cfg.package.version "1.25.1";
 in
 
 {