+ in rec {
+ enable = true;
+ logPerVirtualHost = true;
+ multiProcessingModule = "worker";
+ adminAddr = "httpd@immae.eu";
+ # FIXME: http2
+ # FIXME: voir les autres modules:
+ # authz_core_module
+ # reqtimeout_module
+ # http2_module
+ # version_module
+ # proxy_connect_module
+ # proxy_ftp_module
+ # proxy_scgi_module
+ # proxy_ajp_module
+ # proxy_balancer_module
+ # proxy_express_module
+ # lbmethod_byrequests_module
+ # lbmethod_bytraffic_module
+ # lbmethod_bybusyness_module
+ # lbmethod_heartbeat_module
+
+ extraModules = pkgs.lib.lists.unique (
+ mypkgs.adminer.apache.modules ++
+ mypkgs.connexionswing_dev.apache.modules ++
+ mypkgs.connexionswing_prod.apache.modules ++
+ pkgs.lib.lists.flatten (pkgs.lib.attrsets.mapAttrsToList (n: v: v.modules) apacheConfig) ++
+ [ "macro" ]);
+ extraConfig = builtins.concatStringsSep "\n"
+ (pkgs.lib.attrsets.mapAttrsToList (n: v: v.extraConfig) apacheConfig);
+ virtualHosts = [
+ (withSSL "eldiron" // {
+ listen = [ { ip = "*"; port = 443; } ];
+ hostName = "eldiron.immae.eu";
+ # FIXME: directory needs to exist
+ documentRoot = "/var/www";
+ })
+ (withSSL "eldiron" // {
+ listen = [ { ip = "*"; port = 443; } ];
+ hostName = "db-1.immae.eu";
+ documentRoot = null;
+ extraConfig = builtins.concatStringsSep "\n" [
+ mypkgs.adminer.apache.vhostConf
+ ];
+ })
+ (withSSL "eldiron" // {
+ listen = [ { ip = "*"; port = 443; } ];
+ hostName = "tools.immae.eu";
+ documentRoot = null;
+ extraConfig = builtins.concatStringsSep "\n" [
+ mypkgs.adminer.apache.vhostConf
+ mypkgs.ympd.apache.vhostConf
+ ];
+ })
+ (withSSL "eldiron" // {
+ listen = [ { ip = "*"; port = 443; } ];
+ hostName = "connexionswing.immae.eu";
+ serverAliases = [ "sandetludo.immae.eu" ];
+ documentRoot = mypkgs.connexionswing_dev.webRoot;
+ extraConfig = builtins.concatStringsSep "\n" [
+ mypkgs.connexionswing_dev.apache.vhostConf
+ ];
+ })
+ { # Should go last, default fallback
+ listen = [ { ip = "*"; port = 80; } ];
+ hostName = "redirectSSL";
+ serverAliases = [ "*" ];
+ enableSSL = false;
+ documentRoot = "/var/lib/acme/acme-challenge";
+ extraConfig = ''
+ RewriteEngine on
+ RewriteCond "%{REQUEST_URI}" "!^/\.well-known"
+ RewriteRule ^(.+) https://%{HTTP_HOST}$1 [R=301]
+ # To redirect in specific "VirtualHost *:80", do
+ # RedirectMatch 301 ^/((?!\.well-known.*$).*)$ https://host/$1
+ # rather than rewrite
+ '';
+ }
+ ];