aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/varnish64/varnish.inc6
-rw-r--r--config/varnish64/varnish_backends.xml16
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>