nginx: block all /metrics endpoints

This commit is contained in:
eyjhb 2025-03-14 16:40:19 +01:00
parent cad1ac566a
commit d6be5fefea
Signed by: eyjhb
GPG key ID: 609F508E3239F920

View file

@ -10,6 +10,16 @@ let
-out "$out/ca.pem" -keyout "$out/ca.key"
'';
in {
# block all /metrics endpoints
options.services.nginx.virtualHosts = lib.mkOption {
type = lib.types.attrsOf (lib.types.submodule {
config.locations."/metrics" = lib.mkDefault {
extraConfig = "deny all;";
};
});
};
config = {
services.nginx = {
enable = true;
@ -52,5 +62,6 @@ in {
allowedTCPPorts = [80 443];
allowedUDPPorts = [443];
};
};
}