aboutsummaryrefslogtreecommitdiffstats
path: root/config/haproxy-dev
diff options
context:
space:
mode:
authorthompsa <andy@fud.org.nz>2010-02-08 13:39:48 +1300
committerthompsa <andy@fud.org.nz>2010-02-08 13:39:48 +1300
commitc24b5f93d9cc42d4529c58b59246ed71d83f1602 (patch)
tree0bb43696e0761e759a8a695e4192b15a45ec17c4 /config/haproxy-dev
parentba976e783054c7e8d5d1c22f95684bb98088f124 (diff)
downloadpfsense-packages-c24b5f93d9cc42d4529c58b59246ed71d83f1602.tar.gz
pfsense-packages-c24b5f93d9cc42d4529c58b59246ed71d83f1602.tar.bz2
pfsense-packages-c24b5f93d9cc42d4529c58b59246ed71d83f1602.zip
Skip the listener if it is disabled.
Diffstat (limited to 'config/haproxy-dev')
-rw-r--r--config/haproxy-dev/haproxy.inc76
1 files changed, 40 insertions, 36 deletions
diff --git a/config/haproxy-dev/haproxy.inc b/config/haproxy-dev/haproxy.inc
index b5f62c4f..48ceacaf 100644
--- a/config/haproxy-dev/haproxy.inc
+++ b/config/haproxy-dev/haproxy.inc
@@ -129,6 +129,8 @@ function haproxy_configure() {
if(is_array($a_backends)) {
foreach ($a_backends as $backend) {
+ if($backend['status'] != 'active')
+ continue;
// Define our backend name
$backendinfo = "listen {$backend['name']}\n";
@@ -244,47 +246,49 @@ function haproxy_configure() {
if (is_array($a_pools)) {
foreach ($a_pools as $pool) {
if ($backend['pool'] == $pool['name'] && is_array($pool['ha_servers']['item'])) {
- if($pool['status']=='active') {
- if($pool['cookie_name'])
- fwrite ($fd, "\tcookie\t\t\t" . $pool['cookie_name'] . " insert indirect\n");
+ if($pool['status'] != 'active')
+ continue;
+ if($pool['cookie_name'])
+ fwrite ($fd, "\tcookie\t\t\t" . $pool['cookie_name'] . " insert indirect\n");
+ $uri = $pool['monitor_uri'];
+ if ($pool['monitor_uri'])
$uri = $pool['monitor_uri'];
- if ($pool['monitor_uri'])
- $uri = $pool['monitor_uri'];
- else
- $uri = "/";
- fwrite ($fd, "\toption\t\t\t{$httpchk} HEAD " . $uri . " HTTP/1.0\n");
-
- if($pool['cookie'])
- $cookie = " cookie {$pool['cookie']} ";
- else
- $cookie = "";
- if($pool['advanced']) {
- $advanced = base64_decode($pool['advanced']);
- $advanced_txt = " " . $advanced;
- } else {
- $advanced_txt = "";
+ else
+ $uri = "/";
+ fwrite ($fd, "\toption\t\t\t{$httpchk} HEAD " . $uri . " HTTP/1.0\n");
+
+ if($pool['cookie'])
+ $cookie = " cookie {$pool['cookie']} ";
+ else
+ $cookie = "";
+ if($pool['advanced']) {
+ $advanced = base64_decode($pool['advanced']);
+ $advanced_txt = " " . $advanced;
+ } else {
+ $advanced_txt = "";
+ }
+ if($pool['checkinter'])
+ $checkinter = "check inter {$pool['checkinter']}";
+ else
+ $checkinter = "check inter 1000";
+
+ $a_servers = &$pool['ha_servers']['item'];
+ foreach($a_servers as $be) {
+ if(!$be['port']) {
+ // the listener can specify a default port
+ $be['port'] = $backend['svrport'];
}
- if($pool['checkinter'])
- $checkinter = "check inter {$pool['checkinter']}";
- else
- $checkinter = "check inter 1000";
- $a_servers = &$pool['ha_servers']['item'];
- foreach($a_servers as $be) {
- if(!$be['port']) {
- // the listener can specify a default port
- $be['port'] = $backend['svrport'];
- }
- if(!$be['port']) {
- // last resort, use the frontend port
- $ports = split(",", "{$backend['port']},");
- $be['port'] = $ports[0];
- }
- if (!$be['name'])
- $be['name'] = $be['address'];
- fwrite ($fd, "\tserver\t\t\t" . $be['name'] . " " . $be['address'].":" . $be['port'] . " $cookie " . " $checkinter weight " . $be['weight'] . "{$advanced_txt}\n");
+ if(!$be['port']) {
+ // last resort, use the frontend port
+ $ports = split(",", "{$backend['port']},");
+ $be['port'] = $ports[0];
}
+ if (!$be['name'])
+ $be['name'] = $be['address'];
+ fwrite ($fd, "\tserver\t\t\t" . $be['name'] . " " . $be['address'].":" . $be['port'] . " $cookie " . " $checkinter weight " . $be['weight'] . "{$advanced_txt}\n");
}
+
}
}
}