infrastructure/machines/web01/static/default.nix
sinavir f74fd8c8eb
All checks were successful
build configuration / build_web02 (push) Successful in 1m2s
build configuration / build_vault01 (push) Successful in 1m3s
build configuration / build_compute01 (push) Successful in 1m13s
build configuration / build_storage01 (push) Successful in 1m17s
lint / check (push) Successful in 22s
build configuration / build_web01 (push) Successful in 1m52s
build configuration / build_rescue01 (push) Successful in 50s
feat(simiweb): Move to S3
2024-03-16 16:17:02 +01:00

23 lines
488 B
Nix

{ lib, ... }:
let
inherit (lib) recursiveUpdate;
websites = import ./npins;
mkVhost =
_:
{ outPath, ... }:
{
enableACME = true;
forceSSL = true;
root = "${outPath}/www";
};
in
{
services.nginx.virtualHosts = recursiveUpdate (builtins.mapAttrs mkVhost websites) {
"eleves.dgnum.eu".locations."/".tryFiles = "$uri $uri/index.html /fr/$uri /en/$uri /fr/index.html";
"retired.dgnum.eu".locations."/".tryFiles = "/index.html =404";
};
}