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