]>
Commit | Line | Data |
---|---|---|
8a964143 | 1 | { lib, pkgs, config, myconfig, ... }: |
f759f52e | 2 | let |
f8026b6e IB |
3 | cfg = config.myServices.websites.immae.production; |
4 | varDir = "/var/lib/ftp/immae"; | |
5 | env = myconfig.env.websites.immae; | |
f759f52e | 6 | in { |
f8026b6e | 7 | options.myServices.websites.immae.production.enable = lib.mkEnableOption "enable Immae's website"; |
f759f52e | 8 | |
f8026b6e | 9 | config = lib.mkIf cfg.enable { |
9eae2b47 | 10 | services.webstats.sites = [ { name = "www.immae.eu"; } ]; |
f759f52e | 11 | |
641efb7d IB |
12 | services.phpfpm.pools.immae = { |
13 | listen = "/run/phpfpm/immae.sock"; | |
14 | extraConfig = '' | |
15 | user = wwwrun | |
16 | group = wwwrun | |
17 | listen.owner = wwwrun | |
18 | listen.group = wwwrun | |
f759f52e | 19 | |
641efb7d IB |
20 | pm = ondemand |
21 | pm.max_children = 5 | |
22 | pm.process_idle_timeout = 60 | |
f759f52e | 23 | |
641efb7d IB |
24 | php_admin_value[open_basedir] = "${varDir}:/tmp" |
25 | ''; | |
26 | phpOptions = config.services.phpfpm.phpOptions + '' | |
27 | extension=${pkgs.php}/lib/php/extensions/mysqli.so | |
28 | ''; | |
29 | }; | |
29f8cb85 IB |
30 | services.websites.env.production.modules = [ "proxy_fcgi" ]; |
31 | services.websites.env.production.vhostConfs.immae = { | |
f759f52e | 32 | certName = "eldiron"; |
7df420c2 | 33 | addToCerts = true; |
f759f52e IB |
34 | hosts = [ "www.immae.eu" ]; |
35 | root = varDir; | |
36 | extraConfig = [ | |
37 | '' | |
38 | Use Stats www.immae.eu | |
39 | ||
40 | <FilesMatch "\.php$"> | |
41 | SetHandler "proxy:unix:/run/phpfpm/immae.sock|fcgi://localhost" | |
42 | </FilesMatch> | |
43 | ||
44 | <Directory ${varDir}> | |
45 | DirectoryIndex index.php index.htm index.html | |
46 | Options Indexes FollowSymLinks MultiViews Includes | |
47 | AllowOverride All | |
48 | Require all granted | |
49 | </Directory> | |
50 | ||
51 | <Location /blog_old/> | |
52 | Use LDAPConnect | |
53 | Require ldap-group cn=blog,cn=immae.eu,ou=services,dc=immae,dc=eu | |
54 | </Location> | |
55 | '' | |
56 | ]; | |
57 | }; | |
70606070 | 58 | |
29f8cb85 | 59 | services.websites.env.production.vhostConfs.bouya = { |
70606070 | 60 | certName = "eldiron"; |
7df420c2 | 61 | addToCerts = true; |
70606070 IB |
62 | hosts = [ "bouya.org" "www.bouya.org" ]; |
63 | root = null; | |
64 | extraConfig = [ '' | |
65 | RedirectMatch 301 ^/((?!\.well-known.*$).*)$ https://www.normalesup.org/~bouya/ | |
66 | '' ]; | |
67 | }; | |
f759f52e IB |
68 | }; |
69 | } |