X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fprivate%2Fwebsites%2Fludivinecassal%2Fproduction.nix;h=5761be7af22d352b08d536f502854d931f5997a6;hb=5400b9b6f65451d41a9106fae6fc00f97d83f4ef;hp=1a8b958c9874bd466af471c3ccb304fcb3b6c7ce;hpb=d2e703c560bc029c3d607058de2935bbf1cb0559;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/modules/private/websites/ludivinecassal/production.nix b/modules/private/websites/ludivinecassal/production.nix index 1a8b958..5761be7 100644 --- a/modules/private/websites/ludivinecassal/production.nix +++ b/modules/private/websites/ludivinecassal/production.nix @@ -1,6 +1,6 @@ -{ lib, pkgs, config, myconfig, ... }: +{ lib, pkgs, config, ... }: let - secrets = myconfig.env.websites.ludivinecassal.production; + secrets = config.myEnv.websites.ludivinecassal.production; app = pkgs.webapps.ludivinecassal.override { environment = secrets.environment; }; pcfg = config.services.phpApplication; cfg = config.myServices.websites.ludivinecassal.production; @@ -24,16 +24,16 @@ in { "./bin/console --env=${app.environment} cache:clear --no-warmup" ]; phpOpenbasedir = [ "/tmp" ]; - phpPool = '' - php_admin_value[upload_max_filesize] = 20M - php_admin_value[post_max_size] = 20M - ;php_admin_flag[log_errors] = on - pm = dynamic - pm.max_children = 20 - pm.start_servers = 2 - pm.min_spare_servers = 1 - pm.max_spare_servers = 3 - ''; + phpPool = { + "php_admin_value[upload_max_filesize]" = "20M"; + "php_admin_value[post_max_size]" = "20M"; + #"php_admin_flag[log_errors]" = "on"; + "pm" = "dynamic"; + "pm.max_children" = "20"; + "pm.start_servers" = "2"; + "pm.min_spare_servers" = "1"; + "pm.max_spare_servers" = "3"; + }; phpWatchFiles = [ config.secrets.fullPaths."webapps/${app.environment}-ludivinecassal" ]; @@ -50,7 +50,7 @@ in { parameters: database_host: ${secrets.mysql.host} database_port: ${secrets.mysql.port} - database_name: ${secrets.mysql.name} + database_name: ${secrets.mysql.database} database_user: ${secrets.mysql.user} database_password: ${secrets.mysql.password} database_server_version: ${pkgs.mariadb.mysqlVersion} @@ -68,7 +68,7 @@ in { ldap_base_dn: 'dc=immae,dc=eu' ldap_search_dn: '${secrets.ldap.dn}' ldap_search_password: '${secrets.ldap.password}' - ldap_search_filter: '${secrets.ldap.search}' + ldap_search_filter: '${secrets.ldap.filter}' leapt_im: binary_path: ${pkgs.imagemagick}/bin assetic: @@ -85,6 +85,10 @@ in { root = pcfg.webappDirs.ludivinecassal_prod; extraConfig = [ '' + RewriteEngine on + RewriteCond "%{HTTP_HOST}" "!^ludivinecassal\.com$" [NC] + RewriteRule ^(.+)$ https://ludivinecassal.com$1 [R=302,L] + SetHandler "proxy:unix:${pcfg.phpListenPaths.ludivinecassal_prod}|fcgi://localhost"