nixos/hosts/alpha/caddy.nix

32 lines
908 B
Nix
Raw Normal View History

2024-04-16 01:26:43 +02:00
{...}: {
# See modules/server/caddy.nix
services.caddy = {
# Wildcard certificates are used whenever possible to avoid leaking domains
# to the certificate transparency logs.
virtualHosts = let
# https://caddy.community/t/caddy-server-that-returns-only-ip-address-as-text/6928
ipConfig = ''
templates
header Content-Type text/plain
respond "{{.RemoteIP}}"
'';
in {
# Explicit http:// and https:// disables automatic HTTPS redirect to
# allow for easier curl'ing.
"http://ip.caspervk.net" = {
extraConfig = ipConfig;
};
"https://ip.caspervk.net" = {
useACMEHost = "caspervk.net";
extraConfig = ipConfig;
};
2024-10-13 16:23:07 +02:00
"sortseer.dk" = {
useACMEHost = "sortseer.dk";
extraConfig = ''
redir https://git.caspervk.net/caspervk/sortseer
'';
};
2024-04-16 01:26:43 +02:00
};
};
}