nginx: Make recommended settings global

This commit is contained in:
Simon Bruder 2023-12-16 10:19:20 +01:00
parent a5622c3653
commit 80fcaab244
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC
6 changed files with 10 additions and 28 deletions

View file

@ -36,11 +36,6 @@
services.nginx = {
enable = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
};
networking.firewall.allowedTCPPorts = [ 80 443 ];
systemd.services.nginx.serviceConfig.SupplementaryGroups = lib.singleton "keys";

View file

@ -15,14 +15,7 @@
system.stateVersion = "23.05";
services.nginx = {
enable = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
};
services.nginx.enable = true;
networking.firewall.allowedTCPPorts = [ 80 443 ];
systemd.services.nginx.serviceConfig.SupplementaryGroups = lib.singleton "keys";

View file

@ -22,11 +22,6 @@
services.nginx = {
enable = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts."okarin.sbruder.xyz" = {
enableACME = true;
forceSSL = true;

View file

@ -41,11 +41,6 @@
services.nginx = {
enable = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts."sbruder.de" = {
enableACME = true;
forceSSL = true;

View file

@ -42,11 +42,6 @@
services.nginx = {
enable = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts = {
"vueko.sbruder.de" = {
enableACME = true;

View file

@ -6,6 +6,7 @@ in
options.sbruder.nginx = {
hardening.enable = lib.mkEnableOption "nginx hardening";
privacy.enable = (lib.mkEnableOption "nginx privacy options") // { default = true; };
recommended.enable = (lib.mkEnableOption "recommended options") // { default = true; };
};
config = lib.mkMerge [
@ -26,5 +27,13 @@ in
access_log off;
'';
})
(lib.mkIf cfg.recommended.enable {
services.nginx = {
recommendedGzipSettings = lib.mkDefault true;
recommendedOptimisation = lib.mkDefault true;
recommendedProxySettings = lib.mkDefault true;
recommendedTlsSettings = lib.mkDefault true;
};
})
];
}