0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 21:50:33 +03:00

Merge pull request #119813 from mkg20001/http3

This commit is contained in:
Maciej Krüger 2021-04-19 14:31:02 +02:00 committed by GitHub
commit 9f566fc6bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 77 additions and 9 deletions

View file

@ -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;

View file

@ -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;