nginx: enable http3

This commit is contained in:
Rouven Seifert 2024-04-03 00:01:40 +02:00
parent 1b3c8721ec
commit 02f075b615
Signed by: rouven.seifert
GPG key ID: B95E8FE6B11C4D09
2 changed files with 8 additions and 2 deletions

View file

@ -14,6 +14,7 @@
extraConfig = ''
access_log /var/log/nginx/${name}_access.log;
error_log /var/log/nginx/${name}_error.log;
add_header Alt-Svc 'h3=":443"; ma=86400';
'';
})
);

View file

@ -1,4 +1,4 @@
{ lib, config, ... }:
{ pkgs, lib, config, ... }:
{
# set default options for virtualHosts
options = with lib; {
@ -8,9 +8,13 @@
# split up nginx access logs per vhost
enableACME = true;
forceSSL = true;
# enable http3 for all hosts
quic = true;
http3 = true;
extraConfig = ''
access_log /var/log/nginx/${name}_access.log;
error_log /var/log/nginx/${name}_error.log;
add_header Alt-Svc 'h3=":443"; ma=86400';
'';
})
);
@ -18,13 +22,14 @@
};
config = {
networking.firewall.allowedTCPPorts = [ 80 443 ];
networking.firewall.allowedUDPPorts = [ 443 ];
services.nginx = {
enable = true;
package = pkgs.nginxQuic;
recommendedTlsSettings = true;
recommendedProxySettings = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
# virtualHosts = lib.genAttrs v (name: { extraConfig = " lohustuff goes ith ${name}"; });
};
security.acme = {
acceptTerms = true;