aboutsummaryrefslogtreecommitdiffstats
path: root/config/haproxy-dev/haproxy.inc
diff options
context:
space:
mode:
authorthompsa <andy@fud.org.nz>2010-02-07 16:21:47 +1300
committerthompsa <andy@fud.org.nz>2010-02-07 16:21:47 +1300
commit6a7987846c7d4680a35264f7e27287c61937cf78 (patch)
treecc33a26be7ba8ad402e3b09c2703e1883024fca5 /config/haproxy-dev/haproxy.inc
parentd4f39e68de79ca8823d1b7397e79dd13e24f7dfa (diff)
downloadpfsense-packages-6a7987846c7d4680a35264f7e27287c61937cf78.tar.gz
pfsense-packages-6a7987846c7d4680a35264f7e27287c61937cf78.tar.bz2
pfsense-packages-6a7987846c7d4680a35264f7e27287c61937cf78.zip
Make some of the gui changes as described.
Diffstat (limited to 'config/haproxy-dev/haproxy.inc')
-rw-r--r--config/haproxy-dev/haproxy.inc32
1 files changed, 28 insertions, 4 deletions
diff --git a/config/haproxy-dev/haproxy.inc b/config/haproxy-dev/haproxy.inc
index 536ef1f7..2d7b671f 100644
--- a/config/haproxy-dev/haproxy.inc
+++ b/config/haproxy-dev/haproxy.inc
@@ -214,12 +214,36 @@ function haproxy_configure() {
fwrite ($fd, "\tstats\t\t\tauth " . $backend['stats_username'].":". $backend['stats_password']."\n");
}
- $a_acl=&$frontend['ha_acls']['item'];
+ $a_acl=&$backend['ha_acls']['item'];
if(!is_array($a_acl))
$a_acl=array();
- foreach ($a_acl as $acl)
- fwrite ($fd, "\tacl\t\t\t".$acl['name']."\t\t".$acl['expression']."\n");
+ foreach ($a_acl as $acl) {
+ if ($acl['expression'] == "host_starts_with")
+ $expr = 'hdr_beg(host) -i';
+ else if ($acl['expression'] == "host_ends_with")
+ $expr = 'hdr_end(host) -i';
+ else if ($acl['expression'] == "host_matches")
+ $expr = 'hdr(host) -i';
+ else if ($acl['expression'] == "host_regex")
+ $expr = 'hdr_reg(host) -i';
+ else if ($acl['expression'] == "host_contains")
+ $expr = 'hdr_dir(host) -i';
+ else if ($acl['expression'] == "path_starts_with")
+ $expr = 'path_beg -i';
+ else if ($acl['expression'] == "path_ends_with")
+ $expr = 'path_end -i';
+ else if ($acl['expression'] == "path_matches")
+ $expr = 'path -i';
+ else if ($acl['expression'] == "path_regex")
+ $expr = 'path_reg -i';
+ else if ($acl['expression'] == "path_contains")
+ $expr = 'path_dir -i';
+ else if ($acl['expression'] == "source_ip")
+ $expr = 'src';
+ $expr .= " " . $acl['value'];
+ fwrite ($fd, "\tacl\t\t\t".$acl['name']."\t".$expr."\n");
+ }
$server['backend'] .= " ";
if(is_array($a_servers)) {
@@ -417,4 +441,4 @@ function haproxy_do_xmlrpc_sync($sync_to_ip, $password) {
}
}
-?> \ No newline at end of file
+?>