mirror of
https://git.sr.ht/~rouven/nixos-config
synced 2025-01-18 17:11:39 +01:00
nginx: enable http3
This commit is contained in:
parent
1b3c8721ec
commit
02f075b615
2 changed files with 8 additions and 2 deletions
|
@ -14,6 +14,7 @@
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
access_log /var/log/nginx/${name}_access.log;
|
access_log /var/log/nginx/${name}_access.log;
|
||||||
error_log /var/log/nginx/${name}_error.log;
|
error_log /var/log/nginx/${name}_error.log;
|
||||||
|
add_header Alt-Svc 'h3=":443"; ma=86400';
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ lib, config, ... }:
|
{ pkgs, lib, config, ... }:
|
||||||
{
|
{
|
||||||
# set default options for virtualHosts
|
# set default options for virtualHosts
|
||||||
options = with lib; {
|
options = with lib; {
|
||||||
|
@ -8,9 +8,13 @@
|
||||||
# split up nginx access logs per vhost
|
# split up nginx access logs per vhost
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
|
# enable http3 for all hosts
|
||||||
|
quic = true;
|
||||||
|
http3 = true;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
access_log /var/log/nginx/${name}_access.log;
|
access_log /var/log/nginx/${name}_access.log;
|
||||||
error_log /var/log/nginx/${name}_error.log;
|
error_log /var/log/nginx/${name}_error.log;
|
||||||
|
add_header Alt-Svc 'h3=":443"; ma=86400';
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
@ -18,13 +22,14 @@
|
||||||
};
|
};
|
||||||
config = {
|
config = {
|
||||||
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||||
|
networking.firewall.allowedUDPPorts = [ 443 ];
|
||||||
services.nginx = {
|
services.nginx = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
package = pkgs.nginxQuic;
|
||||||
recommendedTlsSettings = true;
|
recommendedTlsSettings = true;
|
||||||
recommendedProxySettings = true;
|
recommendedProxySettings = true;
|
||||||
recommendedGzipSettings = true;
|
recommendedGzipSettings = true;
|
||||||
recommendedOptimisation = true;
|
recommendedOptimisation = true;
|
||||||
# virtualHosts = lib.genAttrs v (name: { extraConfig = " lohustuff goes ith ${name}"; });
|
|
||||||
};
|
};
|
||||||
security.acme = {
|
security.acme = {
|
||||||
acceptTerms = true;
|
acceptTerms = true;
|
||||||
|
|
Loading…
Reference in a new issue