mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 06:45:16 +01:00
nginx: add vhost.http3
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
This commit is contained in:
parent
4a3bb18683
commit
9530794548
2 changed files with 22 additions and 1 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue