services: nginx: enable prometheus exporter

This commit is contained in:
Antoine Martin 2021-07-13 15:58:43 +02:00
parent 2b59116b8d
commit b6f712b817

View file

@ -18,6 +18,25 @@
networking.firewall.allowedTCPPorts = [ 80 443 ]; networking.firewall.allowedTCPPorts = [ 80 443 ];
services.prometheus = {
exporters.nginx = {
enable = true;
listenAddress = "127.0.0.1";
};
scrapeConfigs = [
{
job_name = "nginx";
static_configs = [{
targets = [ "127.0.0.1:${toString config.services.prometheus.exporters.nginx.port}" ];
labels = {
instance = config.networking.hostName;
};
}];
}
];
};
security.acme = { security.acme = {
acceptTerms = true; acceptTerms = true;
email = "antoine97.martin@gmail.com"; email = "antoine97.martin@gmail.com";