From 601b5fe8c1ff8fd8f9ef28e3409069db289e5bc1 Mon Sep 17 00:00:00 2001 From: clerie Date: Thu, 25 Aug 2022 23:22:05 +0200 Subject: [PATCH] Add ping.clerie.de website --- hosts/web-2/ping.nix | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/hosts/web-2/ping.nix b/hosts/web-2/ping.nix index 9cc1120..c386e8a 100644 --- a/hosts/web-2/ping.nix +++ b/hosts/web-2/ping.nix @@ -5,12 +5,26 @@ "ping.clerie.de" = { enableACME = true; addSSL = true; + root = fetchGit { + url = "https://git.clerie.de/clerie/ping.clerie.de.git"; + ref = "main"; + rev = "c9c0849e1f63fd2e3aeeba8ce19ec44065a5d563"; + }; + /* locations."= /" = { return = ''200 "This domain is used for connectivity checking and captive portal detection\n"''; extraConfig = '' types { } default_type "text/plain; charset=utf-8"; ''; }; + */ + locations."= /ping" = { + return = ''201''; + extraConfig = '' + types { } default_type "text/plain; charset=utf-8"; + add_header Access-Control-Allow-Origin *; + ''; + }; locations."= /nm-check.txt" = { return = ''200 "NetworkManager is online\n"''; extraConfig = '' @@ -26,9 +40,6 @@ add_header Cache-Control "max-age=0, must-revalidate"; ''; }; - locations."/" = { - return = ''404''; - }; extraConfig = '' access_log off; '';