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; };
|
2023-10-02 21:32:54 +02:00
|
|
|
|
2023-12-19 18:38:57 +01:00
|
|
|
inherit (metis) providers;
|
2023-10-02 21:32:54 +02:00
|
|
|
in {
|
|
|
|
services.nginx.virtualHosts."calendrier.dgnum.eu" = {
|
2023-09-25 00:40:47 +02:00
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
2023-12-19 18:38:57 +01:00
|
|
|
root = metis.production;
|
2023-09-25 00:40:47 +02:00
|
|
|
|
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-12-19 18:38:57 +01:00
|
|
|
'';
|
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
|
|
|
};
|
|
|
|
}
|