]>
Commit | Line | Data |
---|---|---|
ab8f306d | 1 | { lib, pkgs, config, ... }: |
f759f52e | 2 | let |
f8026b6e | 3 | cfg = config.myServices.websites.immae.production; |
cb589b2e IB |
4 | varDir = "/var/lib/buildbot/outputs/immae/blog"; |
5 | coursDir = "/var/lib/buildbot/outputs/immae/cours"; | |
6 | rechercheDir = "/var/lib/buildbot/outputs/immae/recherche"; | |
7 | recettesDir = "/var/lib/buildbot/outputs/immae/recettes"; | |
577d00ee | 8 | historyDir = "/var/lib/buildbot/outputs/immae/history"; |
ab8f306d | 9 | env = config.myEnv.websites.immae; |
f759f52e | 10 | in { |
f8026b6e | 11 | options.myServices.websites.immae.production.enable = lib.mkEnableOption "enable Immae's website"; |
f759f52e | 12 | |
f8026b6e | 13 | config = lib.mkIf cfg.enable { |
9eae2b47 | 14 | services.webstats.sites = [ { name = "www.immae.eu"; } ]; |
f759f52e | 15 | |
d3452fc5 IB |
16 | services.websites.env.production.vhostConfs.immae_production = { |
17 | certName = "immae"; | |
18 | addToCerts = true; | |
19 | certMainHost = "www.immae.eu"; | |
20 | hosts = [ "www.immae.eu" "immae.eu" ]; | |
21 | root = varDir; | |
22 | extraConfig = [ | |
f759f52e IB |
23 | '' |
24 | Use Stats www.immae.eu | |
46c99b57 | 25 | Header always set Strict-Transport-Security "max-age=31536000" |
f759f52e | 26 | |
6da0830e IB |
27 | <LocationMatch /.well-known/(webfinger|host-meta)> |
28 | Header always set Referrer-Policy "strict-origin-when-cross-origin" | |
6da0830e IB |
29 | RequestHeader set X-Forwarded-Proto "https" |
30 | ||
31 | RewriteRule ^(.*)$ https://mastodon.immae.eu%{REQUEST_URI} [QSA,L] | |
32 | </LocationMatch> | |
33 | ||
34 | RewriteEngine On | |
35 | RewriteCond "%{REQUEST_URI}" "!^/.well-known/(webfinger|host-meta)" | |
36 | RewriteCond "%{HTTP_HOST}" "!^www\.immae\.eu$" [NC] | |
37 | RewriteRule ^(.+)$ https://www.immae.eu$1 [R=302,L] | |
38 | ||
f759f52e | 39 | <Directory ${varDir}> |
0012da0f IB |
40 | DirectoryIndex index.htm index.html |
41 | Options Indexes FollowSymLinks MultiViews Includes | |
42 | AllowOverride All | |
43 | Require all granted | |
44 | </Directory> | |
45 | ||
46 | Alias /cours ${coursDir} | |
47 | <Directory ${coursDir}> | |
48 | DirectoryIndex index.htm index.html | |
49 | Options Indexes FollowSymLinks MultiViews Includes | |
50 | AllowOverride All | |
51 | Require all granted | |
52 | </Directory> | |
53 | ||
54 | Alias /recherche ${rechercheDir} | |
55 | <Directory ${rechercheDir}> | |
56 | DirectoryIndex index.htm index.html | |
f759f52e IB |
57 | Options Indexes FollowSymLinks MultiViews Includes |
58 | AllowOverride All | |
59 | Require all granted | |
60 | </Directory> | |
f2a18fd6 IB |
61 | |
62 | Alias /recettes ${recettesDir} | |
63 | <Directory ${recettesDir}> | |
64 | DirectoryIndex index.htm index.html | |
65 | Options Indexes FollowSymLinks MultiViews Includes | |
66 | AllowOverride All | |
67 | Require all granted | |
68 | </Directory> | |
7130402c IB |
69 | |
70 | Alias /history ${historyDir} | |
71 | <Directory ${historyDir}> | |
72 | DirectoryIndex index.html | |
73 | AllowOverride None | |
74 | Require all granted | |
75 | </Directory> | |
f759f52e IB |
76 | '' |
77 | ]; | |
78 | }; | |
70606070 | 79 | |
d3452fc5 IB |
80 | services.websites.env.production.vhostConfs.immae_fr = { |
81 | certName = "immae"; | |
8cf37c75 IB |
82 | addToCerts = true; |
83 | hosts = [ "www.immae.fr" "immae.fr" ]; | |
84 | root = null; | |
85 | extraConfig = [ '' | |
86 | RedirectMatch 301 ^/((?!\.well-known.*$).*)$ https://www.immae.eu/chapeaux/ | |
87 | '' ]; | |
88 | }; | |
89 | ||
d3452fc5 IB |
90 | services.websites.env.production.vhostConfs.immae_bouya = { |
91 | certName = "immae"; | |
7df420c2 | 92 | addToCerts = true; |
70606070 IB |
93 | hosts = [ "bouya.org" "www.bouya.org" ]; |
94 | root = null; | |
95 | extraConfig = [ '' | |
96 | RedirectMatch 301 ^/((?!\.well-known.*$).*)$ https://www.normalesup.org/~bouya/ | |
97 | '' ]; | |
98 | }; | |
f759f52e IB |
99 | }; |
100 | } |