nix-infra/config/hosts/web-public-2/virtualHosts/acme-challenge.nix

25 lines
670 B
Nix
Raw Normal View History

2023-08-01 23:02:11 +02:00
{ ... }:
let
acmeDomainMap = {
"jellyfin.grzb.de" = "jellyfin.vs.grzb.de";
"mail-1.grzb.de" = "mail-1.vs.grzb.de";
"social.nekover.se" = "mastodon.vs.grzb.de";
"matrix.nekover.se" = "matrix.vs.grzb.de";
"netbox.grzb.de" = "netbox.vs.grzb.de";
"grafana.grzb.de" = "metrics.vs.grzb.de";
2023-10-16 11:22:48 +02:00
"searx.nekover.se" = "searx.vs.grzb.de";
"turn.nekover.se" = "coturn.vs.grzb.de";
};
in
2023-08-01 23:02:11 +02:00
{
services.nginx.virtualHosts = (builtins.mapAttrs (domain: target: {
listen = [{
addr = "0.0.0.0";
port = 80;
}];
locations."^~ /.well-known/acme-challenge/" = {
proxyPass = "http://${target}:80";
2023-08-05 04:47:14 +02:00
};
}) acmeDomainMap);
2023-08-01 23:02:11 +02:00
}