infrastructure/machines/web01/redirections.nix

41 lines
883 B
Nix
Raw Normal View History

{ sources, ... }:
let
retired_host = "retired.dgnum.eu";
redirections = {
"nuage.beta.rz.ens.wtf".to = "cloud.dgnum.eu";
"notion.rz.ens.wtf".to = "docs.dgnum.eu";
"docs.beta.rz.ens.wtf".to = "pads.dgnum.eu";
"calendrier.eleves.ens.fr" = {
to = "calendrier.dgnum.eu";
ssl = true;
};
} // (builtins.listToAttrs (builtins.map (name: {
inherit name;
value.to = retired_host;
}) retired));
retired = [
"auth.rz.ens.wtf"
"photos.ens.wtf"
"alevins.ens.fr"
"www.climatenavigator.ens.fr"
];
in {
services.nginx.virtualHosts = {
${retired_host} = {
enableACME = true;
forceSSL = true;
root = "${sources.dgnum-retired.outPath}/www";
};
} // (builtins.mapAttrs (host:
{ to, ssl ? false }: {
globalRedirect = to;
enableACME = ssl;
forceSSL = ssl;
}) redirections);
}