2022-12-15 14:58:34 +00:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
2023-09-01 01:46:14 +01:00
|
|
|
}: let
|
|
|
|
inherit (lib.options) mkOption;
|
|
|
|
inherit (lib.modules) mkDefault;
|
|
|
|
inherit (lib.types) submodule attrsOf;
|
|
|
|
in {
|
2023-08-01 19:48:37 +01:00
|
|
|
options = {
|
2023-09-01 01:46:14 +01:00
|
|
|
services.nginx.virtualHosts = mkOption {
|
|
|
|
type = attrsOf (submodule {
|
|
|
|
config.http3 = mkDefault true;
|
2023-08-01 19:48:37 +01:00
|
|
|
});
|
|
|
|
};
|
2022-12-15 14:58:34 +00:00
|
|
|
};
|
|
|
|
|
2023-08-01 19:48:37 +01:00
|
|
|
config = {
|
|
|
|
security.acme = {
|
2023-09-18 03:56:58 +01:00
|
|
|
defaults = {
|
|
|
|
email = "chaoticryptidz@owo.monster";
|
|
|
|
};
|
2023-08-01 19:48:37 +01:00
|
|
|
acceptTerms = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
services.nginx = {
|
|
|
|
enable = true;
|
|
|
|
package = pkgs.nginxQuic;
|
|
|
|
recommendedGzipSettings = true;
|
2023-09-02 16:10:12 +01:00
|
|
|
recommendedBrotliSettings = true;
|
|
|
|
recommendedZstdSettings = true;
|
2023-08-01 19:48:37 +01:00
|
|
|
recommendedOptimisation = true;
|
|
|
|
recommendedProxySettings = true;
|
|
|
|
recommendedTlsSettings = true;
|
2023-09-18 03:56:58 +01:00
|
|
|
clientMaxBodySize = mkDefault "512m";
|
2023-08-01 19:48:37 +01:00
|
|
|
serverNamesHashBucketSize = 1024;
|
2023-09-02 18:17:03 +01:00
|
|
|
appendHttpConfig = ''
|
|
|
|
proxy_headers_hash_max_size 1024;
|
|
|
|
proxy_headers_hash_bucket_size 256;
|
|
|
|
'';
|
2023-08-01 19:48:37 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
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
|
|
|
}
|