From 6751851c905c76e48186471a57e199031100a154 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 16 Nov 2009 21:58:44 -0500 Subject: Unbreak External address feature --- config/haproxy/haproxy.inc | 9 +++-- config/haproxy/haproxy_backends_edit.php | 67 +++++++++++++++++++------------- 2 files changed, 46 insertions(+), 30 deletions(-) (limited to 'config') diff --git a/config/haproxy/haproxy.inc b/config/haproxy/haproxy.inc index 527546ff..9fdd7b49 100644 --- a/config/haproxy/haproxy.inc +++ b/config/haproxy/haproxy.inc @@ -121,12 +121,13 @@ function haproxy_configure() { if(is_array($a_backends)) { foreach ($a_backends as $backend) { - if($backend['extaddr']=='any') + + if($backend['extaddr'] == "any") $listenip = "listen {$backend['name']}\t\t\t0.0.0.0:".$backend['port']."\n"; - else if($frontend['extaddr']=='') - $listenip = "listen {$backend['name']}\t\t\t" . get_current_wan_address('wan').":" . $backend['port']."\n"; + if($backend['extaddr']) + $listenip = "listen {$backend['name']}\t\t\t" . $backend['extaddr'] . ":" . $backend['port']."\n"; else - $listenip = "listen {$backend['name']}\t\t\t" . $backend['extaddr'] . ":" . $backend['port']."\n"; + $listenip = "listen {$backend['name']}\t\t\t" . get_current_wan_address('wan').":" . $backend['port']."\n"; fwrite ($fd, "{$listenip}"); fwrite ($fd, "\tmode\t\t\t".$backend['type'] . "\n"); diff --git a/config/haproxy/haproxy_backends_edit.php b/config/haproxy/haproxy_backends_edit.php index 5751142b..d31430f5 100755 --- a/config/haproxy/haproxy_backends_edit.php +++ b/config/haproxy/haproxy_backends_edit.php @@ -422,26 +422,33 @@ set by the 'retries' parameter (2). - + + + + The source IP address is hashed and divided by the total + weight of the running servers to designate which server will + receive the request. This ensures that the same client IP + address will always reach the same server as long as no + server goes down or up. If the hash result changes due to the + number of running servers changing, many clients will be + directed to a different server. This algorithm is generally + used in TCP mode where no cookie may be inserted. It may also + be used on the Internet to provide a best-effort stickyness + to clients which refuse session cookies. This algorithm is + static, which means that changing a server's weight on the + fly will have no effect. + +
>Round robinEach server is used in turns, according to their weights. - This is the smoothest and fairest algorithm when the server's - processing time remains equally distributed. This algorithm - is dynamic, which means that server weights may be adjusted - on the fly for slow starts for instance.
+ >Round robin + + Each server is used in turns, according to their weights. + This is the smoothest and fairest algorithm when the server's + processing time remains equally distributed. This algorithm + is dynamic, which means that server weights may be adjusted + on the fly for slow starts for instance. +
>Source - The source IP address is hashed and divided by the total - weight of the running servers to designate which server will - receive the request. This ensures that the same client IP - address will always reach the same server as long as no - server goes down or up. If the hash result changes due to the - number of running servers changing, many clients will be - directed to a different server. This algorithm is generally - used in TCP mode where no cookie may be inserted. It may also - be used on the Internet to provide a best-effort stickyness - to clients which refuse session cookies. This algorithm is - static, which means that changing a server's weight on the - fly will have no effect.
@@ -450,7 +457,6 @@ set by the 'retries' parameter (2). onclick='toggle_stats();'>
EXAMPLE: haproxystats - > @@ -500,17 +506,26 @@ set by the 'retries' parameter (2).
- If you want this rule to apply to another IP address than the IP address of the interface chosen above, - select it here (you need to define Virtual IP addresses on the first). Also note that if you are trying to redirect connections on the LAN select the "any" option. + If you want this rule to apply to another IP address than the IP address of the interface chosen above, + select it here (you need to define Virtual IP addresses on the first). + Also note that if you are trying to redirect connections on the LAN select the "any" option. + + Type -- cgit v1.2.3