From 05e7664925c68acb4f4e3bdfcf19dc7357416133 Mon Sep 17 00:00:00 2001 From: Random936 Date: Tue, 2 Sep 2025 20:09:07 -0700 Subject: [PATCH] Some fixes to logging config after file separation --- config/logging.nix | 30 ++++++++++++++++++++++++++---- config/logging/prometheus.nix | 2 +- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/config/logging.nix b/config/logging.nix index 99cb109..8686aa0 100644 --- a/config/logging.nix +++ b/config/logging.nix @@ -21,15 +21,37 @@ services.grafana = { enable = true; settings.server = { - http_addr = "0.0.0.0"; + http_addr = "127.0.0.1"; http_port = 3000; - domain = "logging.randomctf.local"; + domain = "grafana.randomctf.local"; }; }; - services.nginx = { - # Grafana + enable = true; + virtualHosts = { + # Grafana + "grafana.randomctf.local" = { + extraConfig = '' + access_log /var/log/nginx/access.grafana.log; + ''; + locations."/".extraConfig = '' + proxy_set_header Host grafana.randomctf.local; + proxy_pass http://localhost:3000/; + ''; + }; + + # Prometheus + "prometheus.randomctf.local" = { + extraConfig = '' + access_log /var/log/nginx/access.prometheus.log; + ''; + + locations."/".extraConfig = '' + proxy_pass http://localhost:9090/; + ''; + }; + }; }; } diff --git a/config/logging/prometheus.nix b/config/logging/prometheus.nix index edbed6b..d788742 100644 --- a/config/logging/prometheus.nix +++ b/config/logging/prometheus.nix @@ -7,7 +7,7 @@ services.prometheus = { enable = true; - port = 9001; + port = 9090; globalConfig.scrape_interval = "10s"; scrapeConfigs = let node_port = toString config.services.prometheus.exporters.node.port;