diff options
Diffstat (limited to 'config/haproxy/haproxy.inc')
-rw-r--r-- | config/haproxy/haproxy.inc | 9 |
1 files changed, 5 insertions, 4 deletions
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"); |