nixos/modules/homelab/nginx.nix

40 lines
792 B
Nix
Raw Permalink Normal View History

{
config,
lib,
...
}:
lib.mkIf config.fireproof.homelab.enable {
2025-03-09 20:30:33 +01:00
networking.firewall.allowedTCPPorts = [80 443];
services.nginx = {
enable = true;
2025-04-26 20:02:56 +02:00
recommendedTlsSettings = true;
recommendedOptimisation = true;
2025-03-09 20:30:33 +01:00
recommendedProxySettings = true;
2025-04-26 20:02:56 +02:00
recommendedGzipSettings = true;
recommendedBrotliSettings = true;
2026-01-20 23:41:10 +01:00
virtualHosts."status.localhost" = {
2026-01-21 00:11:43 +01:00
listen = [
{
addr = "127.0.0.1";
port = 8070;
}
];
2026-01-20 23:41:10 +01:00
locations."/metrics" = {
extraConfig = ''
stub_status;
access_log off;
allow 127.0.0.1;
allow ::1;
deny all;
'';
};
};
2025-03-09 20:30:33 +01:00
};
security.acme = {
acceptTerms = true;
defaults.email = "nickolaj@fireproof.website";
};
}