aboutsummaryrefslogtreecommitdiffstats
path: root/config/haproxy/haproxy.inc
diff options
context:
space:
mode:
Diffstat (limited to 'config/haproxy/haproxy.inc')
-rw-r--r--config/haproxy/haproxy.inc16
1 files changed, 15 insertions, 1 deletions
diff --git a/config/haproxy/haproxy.inc b/config/haproxy/haproxy.inc
index 3c051034..c9ce9695 100644
--- a/config/haproxy/haproxy.inc
+++ b/config/haproxy/haproxy.inc
@@ -217,7 +217,21 @@ function haproxy_configure() {
$cookie = " cookie {$server['cookie']} ";
else
$cookie = "";
- fwrite ($fd, "\tserver\t\t\t".$server['name']." ".$server['address'].":".$server['port']." $cookie "." check inter 1000 weight ".$server['weight']."\n");
+ if(!$server['port']) {
+ foreach($ports as $port) {
+ $isfirst = false;
+ $server_ports = "";
+ if($port) {
+ if(!$isfirst)
+ $server_ports .= ",";
+ $server_ports .= $port;
+ $isfirst = false;
+ }
+ }
+ } else {
+ $server_ports = $server['port'];
+ }
+ fwrite ($fd, "\tserver\t\t\t" . $server['name'] . " " . $server['address'].":" . $server_ports . " $cookie " . " check inter 1000 weight " . $server['weight'] . "\n");
}
}
}