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 env = config.myEnv.websites.immae;
9 options.myServices.websites.immae.production.enable = lib.mkEnableOption "enable Immae's website";
11 config = lib.mkIf cfg.enable {
12 services.webstats.sites = [ { name = "www.immae.eu"; } ];
14 services.websites.env.production.vhostConfs.immae = {
17 hosts = [ "www.immae.eu" "immae.eu" ];
21 Use Stats www.immae.eu
23 <LocationMatch /.well-known/(webfinger|host-meta)>
24 Header always set Referrer-Policy "strict-origin-when-cross-origin"
25 Header always set Strict-Transport-Security "max-age=31536000"
26 RequestHeader set X-Forwarded-Proto "https"
28 RewriteRule ^(.*)$ https://mastodon.immae.eu%{REQUEST_URI} [QSA,L]
32 RewriteCond "%{REQUEST_URI}" "!^/.well-known/(webfinger|host-meta)"
33 RewriteCond "%{HTTP_HOST}" "!^www\.immae\.eu$" [NC]
34 RewriteRule ^(.+)$ https://www.immae.eu$1 [R=302,L]
37 DirectoryIndex index.htm index.html
38 Options Indexes FollowSymLinks MultiViews Includes
43 Alias /cours ${coursDir}
44 <Directory ${coursDir}>
45 DirectoryIndex index.htm index.html
46 Options Indexes FollowSymLinks MultiViews Includes
51 Alias /recherche ${rechercheDir}
52 <Directory ${rechercheDir}>
53 DirectoryIndex index.htm index.html
54 Options Indexes FollowSymLinks MultiViews Includes
62 services.websites.env.production.vhostConfs.immaeFr = {
65 hosts = [ "www.immae.fr" "immae.fr" ];
68 RedirectMatch 301 ^/((?!\.well-known.*$).*)$ https://www.immae.eu/chapeaux/
72 services.websites.env.production.vhostConfs.bouya = {
75 hosts = [ "bouya.org" "www.bouya.org" ];
78 RedirectMatch 301 ^/((?!\.well-known.*$).*)$ https://www.normalesup.org/~bouya/