diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2010-04-27 01:54:34 -0400 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2010-04-27 01:54:42 -0400 |
commit | 0f34f2799deac46ce80825cd3d50ba06cc7a9866 (patch) | |
tree | 37842377a59c8d62c25c8f959adff49f105fb04e /config/varnish64 | |
parent | 3fdcb2bd0f337503bba03b856023ff50f00ed655 (diff) | |
download | pfsense-packages-0f34f2799deac46ce80825cd3d50ba06cc7a9866.tar.gz pfsense-packages-0f34f2799deac46ce80825cd3d50ba06cc7a9866.tar.bz2 pfsense-packages-0f34f2799deac46ce80825cd3d50ba06cc7a9866.zip |
Setup ACL logic correctly for backend assignments
Diffstat (limited to 'config/varnish64')
-rw-r--r-- | config/varnish64/varnish.inc | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/config/varnish64/varnish.inc b/config/varnish64/varnish.inc index c4fd5b4b..351345f0 100644 --- a/config/varnish64/varnish.inc +++ b/config/varnish64/varnish.inc @@ -126,30 +126,32 @@ EOFA; if($config['installedpackages']['varnishbackends']['config'] != "") { foreach($config['installedpackages']['varnishbackends']['config'] as $backend) { $isfirst = true; - if($config['installedpackages']['varnish_lb_directors']['config'] != "") { - foreach($config['installedpackages']['varnish_lb_directors']['config']['row'] as $urlmapping) { - if(!$isfirst) - $urlmappings .= "else "; - $urlmappings .= <<<EOAU -if (req.http.host == "{$urlmapping['urlmapping']}") { - set req.backend = "{$backend['backend']}"; - set req.http.host = "{$urlmapping['urlmapping']}"; -} - + if($config['installedpackages']['varnishlbdirectors']['config'] != "") { + foreach($config['installedpackages']['varnishlbdirectors']['config'] as $url) { + foreach($url['row'] as $urlmapping) { + if(!$isfirst) + $urlmappings .= "else "; + $urlmappings .= <<<EOAU +if (req.http.host == "{$url['directorurl']}") { + set req.backend = "{$url['directorname']}"; + set req.http.host = "{$url['directorurl']}"; + } EOAU; + $isfirst = false; + } } } - if($config['installedpackages']['varnishbackends']['config']) - foreach($config['installedpackages']['varnishbackends']['config'] as $urlmapping) { - if($config['installedpackages']['varnishbackends']['config']['row']) - foreach($config['installedpackages']['varnishbackends']['config']['row'] as $urlmapping) { - if(!$isfirst) - $urlmappings .= "else "; - $urlmappings .= <<<EOAU -if (req.http.host == "{$urlmapping['urlmapping']}") { - set req.backend = "{$backend['backend']}"; - set req.http.host = "{$urlmapping['url']}"; -} + foreach($config['installedpackages']['varnishbackends']['config'] as $urlmapping) { + if($config['installedpackages']['varnishbackends']['config']) + foreach($config['installedpackages']['varnishbackends']['config'] as $urlmapping) { + foreach($urlmapping['row'] as $url) + if(!$isfirst) + $urlmappings .= "else "; + $urlmappings .= <<<EOAU +if (req.http.host == "{$url['urlmapping']}") { + set req.backend = "{$urlmapping['backendname']}"; + set req.http.host = "{$urlmapping['urlmapping']}"; + } EOAU; $isfirst = false; } |