]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - modules/private/websites/immae/production.nix
Replace myPhpfpm with correct overrides
[perso/Immae/Config/Nix.git] / modules / private / websites / immae / production.nix
CommitLineData
8a964143 1{ lib, pkgs, config, myconfig, ... }:
f759f52e 2let
f8026b6e
IB
3 cfg = config.myServices.websites.immae.production;
4 varDir = "/var/lib/ftp/immae";
5 env = myconfig.env.websites.immae;
f759f52e 6in {
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
f40f5b23 12 services.phpfpm.poolConfigs.immae = ''
f759f52e
IB
13 listen = /run/phpfpm/immae.sock
14 user = wwwrun
15 group = wwwrun
16 listen.owner = wwwrun
17 listen.group = wwwrun
18
19 pm = ondemand
20 pm.max_children = 5
21 pm.process_idle_timeout = 60
22
23 php_admin_value[open_basedir] = "${varDir}:/tmp"
24 '';
daf64e3f
IB
25 services.websites.production.modules = [ "proxy_fcgi" ];
26 services.websites.production.vhostConfs.immae = {
f759f52e 27 certName = "eldiron";
7df420c2 28 addToCerts = true;
f759f52e
IB
29 hosts = [ "www.immae.eu" ];
30 root = varDir;
31 extraConfig = [
32 ''
33 Use Stats www.immae.eu
34
35 <FilesMatch "\.php$">
36 SetHandler "proxy:unix:/run/phpfpm/immae.sock|fcgi://localhost"
37 </FilesMatch>
38
39 <Directory ${varDir}>
40 DirectoryIndex index.php index.htm index.html
41 Options Indexes FollowSymLinks MultiViews Includes
42 AllowOverride All
43 Require all granted
44 </Directory>
45
46 <Location /blog_old/>
47 Use LDAPConnect
48 Require ldap-group cn=blog,cn=immae.eu,ou=services,dc=immae,dc=eu
49 </Location>
50 ''
51 ];
52 };
70606070 53
daf64e3f 54 services.websites.production.vhostConfs.bouya = {
70606070 55 certName = "eldiron";
7df420c2 56 addToCerts = true;
70606070
IB
57 hosts = [ "bouya.org" "www.bouya.org" ];
58 root = null;
59 extraConfig = [ ''
60 RedirectMatch 301 ^/((?!\.well-known.*$).*)$ https://www.normalesup.org/~bouya/
61 '' ];
62 };
f759f52e
IB
63 };
64}