diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2010-04-27 22:27:50 -0400 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2010-04-27 22:27:50 -0400 |
commit | 1ece4960bec4edafa3b678fbab29dd7db65550fd (patch) | |
tree | 49c90e5aef9ed95125b0cf3d8837dff0eb5607fe | |
parent | fb0db804efaa6cb7fedb22c961c1c5c665dd6374 (diff) | |
download | pfsense-packages-1ece4960bec4edafa3b678fbab29dd7db65550fd.tar.gz pfsense-packages-1ece4960bec4edafa3b678fbab29dd7db65550fd.tar.bz2 pfsense-packages-1ece4960bec4edafa3b678fbab29dd7db65550fd.zip |
Allow matching against regexes in the URL as well
-rw-r--r-- | config/varnish64/varnish.inc | 6 | ||||
-rw-r--r-- | config/varnish64/varnish_backends.xml | 16 |
2 files changed, 21 insertions, 1 deletions
diff --git a/config/varnish64/varnish.inc b/config/varnish64/varnish.inc index 33525bdf..042db490 100644 --- a/config/varnish64/varnish.inc +++ b/config/varnish64/varnish.inc @@ -124,10 +124,14 @@ EOAU; foreach($config['installedpackages']['varnishbackends']['config'] as $urlmapping) { if($urlmapping['row']) foreach($urlmapping['row'] as $url) { + if($url['fieldtype']) + $fieldtype = $url['fieldtype']; + else + $fieldtype = "=="; if(!$isfirst) $urlmappings .= "else "; $urlmappings .= <<<EOAU -if (req.http.host == "{$url['urlmapping']}") { +if (req.http.host {$fieldtype} "{$url['urlmapping']}") { set req.backend = {$urlmapping['backendname']}BACKEND; set req.http.host = "{$url['urlmapping']}"; } diff --git a/config/varnish64/varnish_backends.xml b/config/varnish64/varnish_backends.xml index d3bd825e..e426d444 100644 --- a/config/varnish64/varnish_backends.xml +++ b/config/varnish64/varnish_backends.xml @@ -176,6 +176,22 @@ <type>rowhelper</type> <rowhelper> <rowhelperfield> + <fielddescr>Match type</fielddescr> + <fieldname>fieldtype</fieldname> + <description>Select the field type that you would like to use in matching the URL.</description> + <type>select</type> + <options> + <option> + <name>Equals</name> + <value>==</value> + </option> + <option> + <name>Regex</name> + <value>~</value> + </option> + </options> + </rowhelperfield> + <rowhelperfield> <fielddescr>URL</fielddescr> <fieldname>urlmapping</fieldname> <description>Enter the URL that will be mapped to this backend.</description> |