From 7ee619f83d8e3930f3c5d75fabd70a7a2fb23c24 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Thu, 24 Apr 2008 18:32:05 +0000 Subject: [PATCH] Typo fix & NameVirtualHost generation svn path=/nixos/trunk/; revision=11710 --- upstart-jobs/apache-httpd/default.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/upstart-jobs/apache-httpd/default.nix b/upstart-jobs/apache-httpd/default.nix index 8ae1db720581..d22989871311 100644 --- a/upstart-jobs/apache-httpd/default.nix +++ b/upstart-jobs/apache-httpd/default.nix @@ -19,7 +19,7 @@ let canonicalName = (if cfg.enableSSL then "https" else "http") + "://" + cfg.hostName + - (if getPort cfg != (if cfg.enableSSL then 443 else 80) then ":${toString getPort cfg}" else ""); + (if getPort cfg != (if cfg.enableSSL then 443 else 80) then ":${toString (getPort cfg)}" else ""); # Admin address: inherit from the main server if not specified for # a virtual host. @@ -327,8 +327,11 @@ let ${perServerConf true mainCfg} # Always enable virtual hosts; it doesn't seem to hurt. - NameVirtualHost *:80 - NameVirtualHost *:443 + ${let + ports = map getPort allHosts; + uniquePorts = pkgs.lib.uniqList {inputList = ports;}; + in concatMapStrings (port: "NameVirtualHost *:${toString port}\n") uniquePorts + } ${let makeVirtualHost = vhost: ''