]>
Commit | Line | Data |
---|---|---|
ab8f306d | 1 | { lib, pkgs, config, ... }: |
f759f52e | 2 | let |
f8026b6e | 3 | cfg = config.myServices.websites.immae.production; |
8fa7ff2c | 4 | varDir = "/var/lib/buildbot/outputs/immaeEu"; |
0012da0f IB |
5 | coursDir = "/var/lib/buildbot/outputs/cours"; |
6 | rechercheDir = "/var/lib/buildbot/outputs/recherche"; | |
f2a18fd6 | 7 | recettesDir = "/var/lib/buildbot/outputs/recettes"; |
ab8f306d | 8 | env = config.myEnv.websites.immae; |
f759f52e | 9 | in { |
f8026b6e | 10 | options.myServices.websites.immae.production.enable = lib.mkEnableOption "enable Immae's website"; |
f759f52e | 11 | |
f8026b6e | 12 | config = lib.mkIf cfg.enable { |
9eae2b47 | 13 | services.webstats.sites = [ { name = "www.immae.eu"; } ]; |
f759f52e | 14 | |
29f8cb85 | 15 | services.websites.env.production.vhostConfs.immae = { |
f759f52e | 16 | certName = "eldiron"; |
7df420c2 | 17 | addToCerts = true; |
6da0830e | 18 | hosts = [ "www.immae.eu" "immae.eu" ]; |
f759f52e IB |
19 | root = varDir; |
20 | extraConfig = [ | |
21 | '' | |
22 | Use Stats www.immae.eu | |
23 | ||
6da0830e IB |
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" | |
28 | ||
29 | RewriteRule ^(.*)$ https://mastodon.immae.eu%{REQUEST_URI} [QSA,L] | |
30 | </LocationMatch> | |
31 | ||
32 | RewriteEngine On | |
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] | |
36 | ||
f759f52e | 37 | <Directory ${varDir}> |
0012da0f IB |
38 | DirectoryIndex index.htm index.html |
39 | Options Indexes FollowSymLinks MultiViews Includes | |
40 | AllowOverride All | |
41 | Require all granted | |
42 | </Directory> | |
43 | ||
44 | Alias /cours ${coursDir} | |
45 | <Directory ${coursDir}> | |
46 | DirectoryIndex index.htm index.html | |
47 | Options Indexes FollowSymLinks MultiViews Includes | |
48 | AllowOverride All | |
49 | Require all granted | |
50 | </Directory> | |
51 | ||
52 | Alias /recherche ${rechercheDir} | |
53 | <Directory ${rechercheDir}> | |
54 | DirectoryIndex index.htm index.html | |
f759f52e IB |
55 | Options Indexes FollowSymLinks MultiViews Includes |
56 | AllowOverride All | |
57 | Require all granted | |
58 | </Directory> | |
f2a18fd6 IB |
59 | |
60 | Alias /recettes ${recettesDir} | |
61 | <Directory ${recettesDir}> | |
62 | DirectoryIndex index.htm index.html | |
63 | Options Indexes FollowSymLinks MultiViews Includes | |
64 | AllowOverride All | |
65 | Require all granted | |
66 | </Directory> | |
f759f52e IB |
67 | '' |
68 | ]; | |
69 | }; | |
70606070 | 70 | |
8cf37c75 IB |
71 | services.websites.env.production.vhostConfs.immaeFr = { |
72 | certName = "eldiron"; | |
73 | addToCerts = true; | |
74 | hosts = [ "www.immae.fr" "immae.fr" ]; | |
75 | root = null; | |
76 | extraConfig = [ '' | |
77 | RedirectMatch 301 ^/((?!\.well-known.*$).*)$ https://www.immae.eu/chapeaux/ | |
78 | '' ]; | |
79 | }; | |
80 | ||
29f8cb85 | 81 | services.websites.env.production.vhostConfs.bouya = { |
70606070 | 82 | certName = "eldiron"; |
7df420c2 | 83 | addToCerts = true; |
70606070 IB |
84 | hosts = [ "bouya.org" "www.bouya.org" ]; |
85 | root = null; | |
86 | extraConfig = [ '' | |
87 | RedirectMatch 301 ^/((?!\.well-known.*$).*)$ https://www.normalesup.org/~bouya/ | |
88 | '' ]; | |
89 | }; | |
f759f52e IB |
90 | }; |
91 | } |