aboutsummaryrefslogtreecommitdiffstats
path: root/config/haproxy
diff options
context:
space:
mode:
authorsullrich <sullrich@pfsense.org>2009-12-15 09:00:59 -0500
committersullrich <sullrich@pfsense.org>2009-12-15 09:00:59 -0500
commit64d7fb839093018867e7f2fae3690a0946686dcf (patch)
treea908976b2c41f88bef451bdf24d65ccfa9083c91 /config/haproxy
parentd33aa424529c46ec941496801786f530f6b916ee (diff)
downloadpfsense-packages-64d7fb839093018867e7f2fae3690a0946686dcf.tar.gz
pfsense-packages-64d7fb839093018867e7f2fae3690a0946686dcf.tar.bz2
pfsense-packages-64d7fb839093018867e7f2fae3690a0946686dcf.zip
Allow leaving the server port blank to pick up the Frontend port selection
Diffstat (limited to 'config/haproxy')
-rw-r--r--config/haproxy/haproxy.inc16
-rwxr-xr-xconfig/haproxy/haproxy_servers_edit.php6
2 files changed, 19 insertions, 3 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");
}
}
}
diff --git a/config/haproxy/haproxy_servers_edit.php b/config/haproxy/haproxy_servers_edit.php
index 8ee34379..9ea8e64b 100755
--- a/config/haproxy/haproxy_servers_edit.php
+++ b/config/haproxy/haproxy_servers_edit.php
@@ -64,8 +64,8 @@ if ($_POST) {
unset($input_errors);
$pconfig = $_POST;
- $reqdfields = explode(" ", "name address port weight");
- $reqdfieldsn = explode(",", "Name,Address,Port,Weight");
+ $reqdfields = explode(" ", "name address weight");
+ $reqdfieldsn = explode(",", "Name,Address,Weight");
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
@@ -256,6 +256,8 @@ function clearcombo(){
<td width="22%" valign="top" class="vncellreq">Port</td>
<td width="78%" class="vtable" colspan="2">
<input name="port" type="text" <?if(isset($pconfig['port'])) echo "value=\"{$pconfig['port']}\"";?> size="5">
+ <br/>
+ NOTE: Leave blank to use Frontend port selection.
</td>
</tr>
<tr align="left">