aboutsummaryrefslogtreecommitdiff
path: root/modules/private/websites/papa
diff options
context:
space:
mode:
Diffstat (limited to 'modules/private/websites/papa')
-rw-r--r--modules/private/websites/papa/maison_bbc.nix68
1 files changed, 68 insertions, 0 deletions
diff --git a/modules/private/websites/papa/maison_bbc.nix b/modules/private/websites/papa/maison_bbc.nix
new file mode 100644
index 0000000..7295de8
--- /dev/null
+++ b/modules/private/websites/papa/maison_bbc.nix
@@ -0,0 +1,68 @@
1{ lib, pkgs, config, ... }:
2let
3 cfg = config.myServices.websites.papa.maison_bbc;
4 varDir = "/var/lib/ftp/papa/site";
5in {
6 options.myServices.websites.papa.maison_bbc.enable = lib.mkEnableOption "enable Papa Maison bbc website";
7
8 config = lib.mkIf cfg.enable {
9 services.duplyBackup.profiles.papa_maison_bbc.rootDir = varDir;
10 services.webstats.sites = [ { name = "maison.bbc.bouya.org"; } ];
11 services.phpfpm.pools.papa_maison_bbc = {
12 listen = "/run/phpfpm/papa_maison_bbc.sock";
13 extraConfig = ''
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}"
24 '';
25 phpOptions = config.services.phpfpm.phpOptions + ''
26 extension=${pkgs.php}/lib/php/extensions/mysqli.so
27 '';
28 };
29
30 services.websites.env.production.modules = [ "proxy_fcgi" ];
31 services.websites.env.production.vhostNoSSLConfs.papa_maison_bbc = {
32 hosts = [ "maison.bbc.bouya.org" ];
33 root = varDir;
34 extraConfig = [
35 ''
36 RedirectMatch 301 ^/((?!(\.well-known|add.php).*$).*)$ https://maison.bbc.bouya.org/$1
37 <Directory ${varDir}>
38 DirectoryIndex index.php index.htm index.html
39 AllowOverride None
40 Require all granted
41 <FilesMatch "\.php$">
42 SetHandler "proxy:unix:/run/phpfpm/papa_maison_bbc.sock|fcgi://localhost"
43 </FilesMatch>
44 </Directory>
45 ''
46 ];
47 };
48 services.websites.env.production.vhostConfs.papa_maison_bbc = {
49 certName = "papa";
50 addToCerts = true;
51 hosts = [ "maison.bbc.bouya.org" ];
52 root = varDir;
53 extraConfig = [
54 ''
55 <Directory ${varDir}>
56 DirectoryIndex index.php index.htm index.html
57 AllowOverride None
58 Require all granted
59 <FilesMatch "\.php$">
60 SetHandler "proxy:unix:/run/phpfpm/papa_maison_bbc.sock|fcgi://localhost"
61 </FilesMatch>
62 </Directory>
63 ''
64 ];
65 };
66 };
67}
68