From 8df556f5552ed05715514c5b61a7226b1f176591 Mon Sep 17 00:00:00 2001 From: Mel Date: Fri, 22 Aug 2025 03:46:33 +0200 Subject: Add goatcounter to mel.gg Signed-off-by: Mel --- services/goatcounter.nix | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/services/goatcounter.nix b/services/goatcounter.nix index b463b27..760a958 100644 --- a/services/goatcounter.nix +++ b/services/goatcounter.nix @@ -49,15 +49,34 @@ in ]; }; - services.nginx.virtualHosts."goat.rnrd.eu" = { - useACMEHost = "rnrd.eu"; - forceSSL = true; - locations."/" = { - proxyPass = "http://127.0.0.1:${toString goatcounterLocalPort}/"; - proxyWebsockets = true; + services.nginx.virtualHosts = + let + vhost = + extra: + { + forceSSL = true; + locations."/" = { + proxyPass = "http://127.0.0.1:${toString goatcounterLocalPort}/"; + proxyWebsockets = true; + }; + extraConfig = '' + access_log /var/log/nginx/goat.access.log json_combined; + ''; + } + // extra; + + domain = { + renard = { + useACMEHost = "rnrd.eu"; + }; + + other = { + enableACME = true; + }; + }; + in + { + "goat.rnrd.eu" = vhost domain.renard; + "stats.mel.gg" = vhost domain.other; }; - extraConfig = '' - access_log /var/log/nginx/goat.access.log json_combined; - ''; - }; } -- cgit 1.4.1