X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fprivate%2Fwebsites%2Fchloe%2Fproduction.nix;h=83f6c9b6a07720ffc9bb783c67d53e1603fc5065;hb=5400b9b6f65451d41a9106fae6fc00f97d83f4ef;hp=3d267f2494595774004608769ddd7f60d028c926;hpb=ab8f306d7c2c49b8116e1af7b355ed2384617ed9;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/modules/private/websites/chloe/production.nix b/modules/private/websites/chloe/production.nix index 3d267f2..83f6c9b 100644 --- a/modules/private/websites/chloe/production.nix +++ b/modules/private/websites/chloe/production.nix @@ -19,8 +19,9 @@ in { systemd.services.phpfpm-chloe_prod.after = lib.mkAfter chloe.phpFpm.serviceDeps; systemd.services.phpfpm-chloe_prod.wants = chloe.phpFpm.serviceDeps; services.phpfpm.pools.chloe_prod = { - listen = chloe.phpFpm.socket; - extraConfig = chloe.phpFpm.pool; + user = config.services.httpd.Prod.user; + group = config.services.httpd.Prod.group; + settings = chloe.phpFpm.pool; phpOptions = config.services.phpfpm.phpOptions + '' extension=${pkgs.php}/lib/php/extensions/mysqli.so ''; @@ -33,7 +34,14 @@ in { certMainHost = "osteopathe-cc.fr"; hosts = ["osteopathe-cc.fr" "www.osteopathe-cc.fr" ]; root = chloe.apache.root; - extraConfig = [ chloe.apache.vhostConf ]; + extraConfig = [ + '' + RewriteEngine On + RewriteCond "%{HTTP_HOST}" "!^www\.osteopathe-cc\.fr$" [NC] + RewriteRule ^(.+)$ https://www.osteopathe-cc.fr$1 [R=302,L] + '' + (chloe.apache.vhostConf config.services.phpfpm.pools.chloe_prod.socket) + ]; }; services.websites.env.production.watchPaths = [ "/var/secrets/webapps/${chloe.app.environment}-chloe"