1 { lib, pkgs, config, ... }:
3 cfg = config.myServices.websites.immae.production;
4 varDir = "/var/lib/buildbot/outputs/immaeEu";
5 coursDir = "/var/lib/buildbot/outputs/cours";
6 rechercheDir = "/var/lib/buildbot/outputs/recherche";
7 recettesDir = "/var/lib/buildbot/outputs/recettes";
8 env = config.myEnv.websites.immae;
10 options.myServices.websites.immae.production.enable = lib.mkEnableOption "enable Immae's website";
12 config = lib.mkIf cfg.enable {
13 services.webstats.sites = [ { name = "www.immae.eu"; } ];
15 services.websites.env.production.vhostConfs.immae = {
18 hosts = [ "www.immae.eu" "immae.eu" ];
22 Use Stats www.immae.eu
24 <LocationMatch /.well-known/(webfinger|host-meta)>
25 Header always set Referrer-Policy "strict-origin-when-cross-origin"
26 Header always set Strict-Transport-Security "max-age=31536000"
27 RequestHeader set X-Forwarded-Proto "https"
29 RewriteRule ^(.*)$ https://mastodon.immae.eu%{REQUEST_URI} [QSA,L]
33 RewriteCond "%{REQUEST_URI}" "!^/.well-known/(webfinger|host-meta)"
34 RewriteCond "%{HTTP_HOST}" "!^www\.immae\.eu$" [NC]
35 RewriteRule ^(.+)$ https://www.immae.eu$1 [R=302,L]
38 DirectoryIndex index.htm index.html
39 Options Indexes FollowSymLinks MultiViews Includes
44 Alias /cours ${coursDir}
45 <Directory ${coursDir}>
46 DirectoryIndex index.htm index.html
47 Options Indexes FollowSymLinks MultiViews Includes
52 Alias /recherche ${rechercheDir}
53 <Directory ${rechercheDir}>
54 DirectoryIndex index.htm index.html
55 Options Indexes FollowSymLinks MultiViews Includes
60 Alias /recettes ${recettesDir}
61 <Directory ${recettesDir}>
62 DirectoryIndex index.htm index.html
63 Options Indexes FollowSymLinks MultiViews Includes
71 services.websites.env.production.vhostConfs.immaeFr = {
74 hosts = [ "www.immae.fr" "immae.fr" ];
77 RedirectMatch 301 ^/((?!\.well-known.*$).*)$ https://www.immae.eu/chapeaux/
81 services.websites.env.production.vhostConfs.bouya = {
84 hosts = [ "bouya.org" "www.bouya.org" ];
87 RedirectMatch 301 ^/((?!\.well-known.*$).*)$ https://www.normalesup.org/~bouya/