]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - nixops/modules/websites/chloe/chloe.nix
Move production websites to use stable web directories
[perso/Immae/Config/Nix.git] / nixops / modules / websites / chloe / chloe.nix
index 9752db63b7f81c059100e2875a4ae3a2c97ca25a..80e555479600aaa36b909760a1fc3474c8b783b7 100644 (file)
@@ -40,10 +40,12 @@ let
         pm.max_spare_servers = 3
         ''}'';
     };
-    apache = {
+    apache = rec {
       user = "wwwrun";
       group = "wwwrun";
       modules = [ "proxy_fcgi" ];
+      webappName = "chloe_${environment}";
+      root = "/run/current-system/webapps/${webappName}";
       vhostConf = ''
         RewriteEngine On
         ${if environment == "prod" then ''
@@ -54,16 +56,16 @@ let
           SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost"
         </FilesMatch>
 
-        <Directory ${webRoot}>
+        <Directory ${root}>
           DirectoryIndex index.php index.htm index.html
           Options -Indexes +FollowSymLinks +MultiViews +Includes
-          Include ${webRoot}/htaccess.txt
+          Include ${root}/htaccess.txt
 
           AllowOverride AuthConfig FileInfo Limit
           Require all granted
         </Directory>
 
-        <DirectoryMatch "${webRoot}/squelettes">
+        <DirectoryMatch "${root}/squelettes">
           Require all denied
         </DirectoryMatch>