2023-09-25 00:40:47 +02:00
|
|
|
{ lib, pkgs, sources, ... }:
|
|
|
|
|
|
|
|
let
|
2023-10-20 20:10:55 +02:00
|
|
|
metis = import sources.metis { inherit pkgs; };
|
|
|
|
package = metis.production;
|
|
|
|
inherit (metis) providers;
|
2023-09-25 00:40:47 +02:00
|
|
|
|
2023-09-28 12:14:38 +02:00
|
|
|
|
2023-10-02 21:32:54 +02:00
|
|
|
|
|
|
|
in {
|
|
|
|
services.nginx.virtualHosts."calendrier.dgnum.eu" = {
|
|
|
|
serverAliases = [
|
|
|
|
"calendrier.eleves.ens.fr"
|
|
|
|
];
|
2023-09-25 00:40:47 +02:00
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
|
|
|
root = package;
|
|
|
|
|
2023-10-20 20:10:55 +02:00
|
|
|
locations = lib.mapAttrs' (name: value:
|
2023-09-25 00:40:47 +02:00
|
|
|
lib.nameValuePair "/cal/${name}/" {
|
|
|
|
extraConfig = ''
|
|
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
|
|
proxy_set_header X-Forwarded-Server $host;
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
2023-10-20 20:10:55 +02:00
|
|
|
proxy_pass ${value};
|
|
|
|
'';
|
2023-09-25 00:40:47 +02:00
|
|
|
}) providers;
|
2023-10-01 22:50:15 +02:00
|
|
|
|
|
|
|
extraConfig = ''
|
|
|
|
rewrite ^/calendrier(.*)$ $1 permanent;
|
|
|
|
'';
|
2023-09-25 00:40:47 +02:00
|
|
|
};
|
|
|
|
}
|