nixfiles/profiles/nginx.nix

52 lines
1.1 KiB
Nix
Raw Normal View History

2022-12-15 14:58:34 +00:00
{
pkgs,
lib,
...
}: let
inherit (lib.options) mkOption;
inherit (lib.modules) mkDefault;
inherit (lib.types) submodule attrsOf;
in {
options = {
services.nginx.virtualHosts = mkOption {
type = attrsOf (submodule {
config.http3 = mkDefault true;
});
};
2022-12-15 14:58:34 +00:00
};
config = {
security.acme = {
2023-09-18 03:56:58 +01:00
defaults = {
email = "chaoticryptidz@owo.monster";
};
acceptTerms = true;
};
services.nginx = {
enable = true;
package = pkgs.nginxQuic;
recommendedGzipSettings = true;
2023-09-02 16:10:12 +01:00
recommendedBrotliSettings = true;
recommendedZstdSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
2023-09-18 03:56:58 +01:00
clientMaxBodySize = mkDefault "512m";
serverNamesHashBucketSize = 1024;
2023-09-02 18:17:03 +01:00
appendHttpConfig = ''
proxy_headers_hash_max_size 1024;
proxy_headers_hash_bucket_size 256;
'';
};
services.logrotate.settings.nginx = {
minsize = "50M";
rotate = "4"; # 4 files of 50mb each
compress = "";
};
services.logrotate.settings.nginx.enable = true;
2021-12-28 21:42:46 +00:00
};
2022-11-02 11:32:03 +00:00
}