1
0

Add captive portal detection service

This commit is contained in:
clerie 2022-02-26 16:14:07 +01:00
parent ad7acad5bd
commit f8d69b1784
2 changed files with 30 additions and 0 deletions

View File

@ -12,6 +12,7 @@
./ip.nix
./meow.nix
./milchinsel.nix
./ping.nix
./prediger.nix
./public.nix
./radicale.nix

29
hosts/web-2/ping.nix Normal file
View File

@ -0,0 +1,29 @@
{ ... }:
{
services.nginx.virtualHosts = {
"ping.clerie.de" = {
enableACME = true;
addSSL = true;
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."/nm-check.txt" = {
return = ''200 "NetworkManager is online\n"'';
extraConfig = ''
types { } default_type "text_plain; charset=utf-8";
add_header Cache-Control "max-age=0, must-revalidate";
'';
};
locations."/" = {
return = ''404'';
};
extraConfig = ''
access_log off;
'';
};
};
}