System/modules/linux/services/nginx.nix

31 lines
767 B
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
let nathan = config.nathan;
in with lib; {
config = mkMerge [
(mkIf nathan.services.nginx.enable {
networking.firewall = {
allowedTCPPorts = [ 80 443 ];
allowedUDPPorts = [ 80 443 ];
};
services.nginx = {
enable = true;
recommendedTlsSettings = true;
recommendedOptimisation = true;
recommendedGzipSettings = true;
recommendedProxySettings = true;
};
2023-06-19 02:43:14 -04:00
# Only keep 7 days of logs
services.logrotate.settings.nginx = {
rotate = 7;
frequency = "daily";
};
})
(mkIf nathan.services.nginx.acme {
security.acme = {
defaults.email = nathan.config.email;
acceptTerms = true;
};
})
];
}