diff options
author | Torben Nielsen <torben@t-hoerup.dk> | 2013-03-04 21:38:21 +0100 |
---|---|---|
committer | Torben Nielsen <torben@t-hoerup.dk> | 2013-03-04 21:38:21 +0100 |
commit | 179db50fb0ed2db1836fb019e673f6632d46a668 (patch) | |
tree | 0af191b314e4d006439b60e9b58f754b8d9b3f16 /config | |
parent | 0e21a5f32bbc00e783881ef748a15c424743e618 (diff) | |
download | pfsense-packages-179db50fb0ed2db1836fb019e673f6632d46a668.tar.gz pfsense-packages-179db50fb0ed2db1836fb019e673f6632d46a668.tar.bz2 pfsense-packages-179db50fb0ed2db1836fb019e673f6632d46a668.zip |
add option for setting per backend advanced settings (current only takes pr server)
Diffstat (limited to 'config')
-rw-r--r-- | config/haproxy-devel/haproxy.inc | 10 | ||||
-rw-r--r-- | config/haproxy-devel/haproxy_pool_edit.php | 19 |
2 files changed, 26 insertions, 3 deletions
diff --git a/config/haproxy-devel/haproxy.inc b/config/haproxy-devel/haproxy.inc index 05264c87..559788c7 100644 --- a/config/haproxy-devel/haproxy.inc +++ b/config/haproxy-devel/haproxy.inc @@ -377,6 +377,16 @@ function write_backend($fd, $name, $pool, $frontend) { $uri = "/"; fwrite ($fd, "\toption\t\t\t{$httpchk} HEAD " . $uri . " HTTP/1.0\n"); + if ($pool['advanced_backend']) { + $adv_be = explode("\n", base64_decode($pool['advanced_backend'])); + foreach($adv_be as $adv_line) { + $adv_line = trim($adv_line); + if ($adv_line != "") { + fwrite($fd, "\t" . $adv_line . "\n"); + } + } + } + if($pool['cookie'] && strtolower($frontend['type']) == "http") $cookie = " cookie {$pool['cookie']} "; else diff --git a/config/haproxy-devel/haproxy_pool_edit.php b/config/haproxy-devel/haproxy_pool_edit.php index b8cb5db6..78cdc7c9 100644 --- a/config/haproxy-devel/haproxy_pool_edit.php +++ b/config/haproxy-devel/haproxy_pool_edit.php @@ -56,6 +56,7 @@ if (isset($id) && $a_pools[$id]) { $pconfig['monitor_uri'] = $a_pools[$id]['monitor_uri']; $pconfig['cookie'] = $a_pools[$id]['cookie']; $pconfig['advanced'] = base64_decode($a_pools[$id]['advanced']); + $pconfig['advanced_backend'] = base64_decode($a_pools[$id]['advanced_backend']); $pconfig['a_servers']=&$a_pools[$id]['ha_servers']['item']; foreach($simplefields as $stat) @@ -171,6 +172,7 @@ if ($_POST) { update_if_changed("name", $pool['name'], $_POST['name']); update_if_changed("cookie", $pool['cookie'], $_POST['cookie']); update_if_changed("advanced", $pool['advanced'], base64_encode($_POST['advanced'])); + update_if_changed("advanced_backend", $pool['advanced_backend'], base64_encode($_POST['advanced_backend'])); update_if_changed("checkinter", $pool['checkinter'], $_POST['checkinter']); update_if_changed("monitor_uri", $pool['monitor_uri'], $_POST['monitor_uri']); @@ -443,13 +445,24 @@ row_helper(); </td> </tr> <tr align="left"> - <td width="22%" valign="top" class="vncell">Advanced pass thru</td> + <td width="22%" valign="top" class="vncell">Per server pass thru</td> <td width="78%" class="vtable" colspan="2"> - <textarea name='advanced' rows="4" cols="70" id='advanced'><?php echo $pconfig['advanced']; ?></textarea> + <input type="text" name='advanced' id='advanced' value='<?php echo $pconfig['advanced']; ?>' size="64"> <br/> - NOTE: paste text into this box that you would like to pass thru. + NOTE: paste text into this box that you would like to pass thru. Applied to each 'server' line. </td> </tr> + + <tr align="left"> + <td width="22%" valign="top" class="vncell">Backend pass thru</td> + <td width="78%" class="vtable" colspan="2"> + <textarea rows="4" cols="70" name='advanced_backend' id='advanced_backend'><?php echo $pconfig['advanced_backend']; ?></textarea> + <br/> + NOTE: paste text into this box that you would like to pass thru. Applied to the backend section. + </td> + </tr> + + </table> <br/> <table width="100%" border="0" cellpadding="6" cellspacing="0"> |