]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - nixops/modules/websites/chloe/chloe.nix
Move integration websites to use stable web directory
[perso/Immae/Config/Nix.git] / nixops / modules / websites / chloe / chloe.nix
index 9752db63b7f81c059100e2875a4ae3a2c97ca25a..3b92af33242f4bc8e8190b11bf5587145262b95f 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 ${if environment == "dev" then root else webRoot}>
           DirectoryIndex index.php index.htm index.html
           Options -Indexes +FollowSymLinks +MultiViews +Includes
-          Include ${webRoot}/htaccess.txt
+          Include ${if environment == "dev" then root else webRoot}/htaccess.txt
 
           AllowOverride AuthConfig FileInfo Limit
           Require all granted
         </Directory>
 
-        <DirectoryMatch "${webRoot}/squelettes">
+        <DirectoryMatch "${if environment == "dev" then root else webRoot}/squelettes">
           Require all denied
         </DirectoryMatch>