diff options
author | Maciej Krüger <mkg20001@gmail.com> | 2021-04-18 18:53:21 +0200 |
---|---|---|
committer | Maciej Krüger <mkg20001@gmail.com> | 2021-04-18 20:20:24 +0200 |
commit | 9530794548602530abe0b97a3196b239ec5d1bce (patch) | |
tree | 6f63f0bbcd2f2d9c482bfa0d303a4e2b4906a30b /nixos/modules/services/web-servers | |
parent | 4a3bb18683644848ca3b0fc7eca23b4927ab3d89 (diff) | |
download | nixpkgs-9530794548602530abe0b97a3196b239ec5d1bce.tar nixpkgs-9530794548602530abe0b97a3196b239ec5d1bce.tar.gz nixpkgs-9530794548602530abe0b97a3196b239ec5d1bce.tar.bz2 nixpkgs-9530794548602530abe0b97a3196b239ec5d1bce.tar.lz nixpkgs-9530794548602530abe0b97a3196b239ec5d1bce.tar.xz nixpkgs-9530794548602530abe0b97a3196b239ec5d1bce.tar.zst nixpkgs-9530794548602530abe0b97a3196b239ec5d1bce.zip |
nginx: add vhost.http3
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
Diffstat (limited to 'nixos/modules/services/web-servers')
-rw-r--r-- | nixos/modules/services/web-servers/nginx/default.nix | 10 | ||||
-rw-r--r-- | nixos/modules/services/web-servers/nginx/vhost-options.nix | 13 |
2 files changed, 22 insertions, 1 deletions
diff --git a/nixos/modules/services/web-servers/nginx/default.nix b/nixos/modules/services/web-servers/nginx/default.nix index 389911ffcce..51c2f3febdc 100644 --- a/nixos/modules/services/web-servers/nginx/default.nix +++ b/nixos/modules/services/web-servers/nginx/default.nix @@ -249,7 +249,15 @@ let + optionalString (ssl && vhost.http2) "http2 " + optionalString vhost.default "default_server " + optionalString (extraParameters != []) (concatStringsSep " " extraParameters) - + ";"; + + ";" + + (if ssl && vhost.http3 then '' + # UDP listener for **QUIC+HTTP/3 + listen ${addr}:${toString port} http3 reuseport; + # Advertise that HTTP/3 is available + add_header Alt-Svc 'h3=":443"'; + # Sent when QUIC was used + add_header QUIC-Status $quic; + '' else ""); redirectListen = filter (x: !x.ssl) defaultListen; diff --git a/nixos/modules/services/web-servers/nginx/vhost-options.nix b/nixos/modules/services/web-servers/nginx/vhost-options.nix index cf211ea9a71..1f5fe6a368c 100644 --- a/nixos/modules/services/web-servers/nginx/vhost-options.nix +++ b/nixos/modules/services/web-servers/nginx/vhost-options.nix @@ -151,6 +151,19 @@ with lib; ''; }; + http3 = mkOption { + type = types.bool; + default = false; + description = '' + Whether to enable HTTP 3. + This requires using <literal>pkgs.nginxQuic</literal> package + which can be achived by setting <literal>services.nginx.package = pkgs.nginxQuic;</literal>. + Note that HTTP 3 support is experimental and + *not* yet recommended for production. + Read more at https://quic.nginx.org/ + ''; + }; + root = mkOption { type = types.nullOr types.path; default = null; |