aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2010-04-27 20:47:01 -0400
committerScott Ullrich <sullrich@pfsense.org>2010-04-27 20:47:01 -0400
commit8e0ce3108e598bb33f8677867f435c1571a844d5 (patch)
tree4293c96aef1dc93193584d8f9f406cd8af940664
parentdef68e846a9a8af2ffb72ae2cd4fec38ca39f03d (diff)
downloadpfsense-packages-8e0ce3108e598bb33f8677867f435c1571a844d5.tar.gz
pfsense-packages-8e0ce3108e598bb33f8677867f435c1571a844d5.tar.bz2
pfsense-packages-8e0ce3108e598bb33f8677867f435c1571a844d5.zip
More cleanups
-rw-r--r--config/varnish64/varnish.inc40
1 files changed, 16 insertions, 24 deletions
diff --git a/config/varnish64/varnish.inc b/config/varnish64/varnish.inc
index 4a2bac07..4f54d288 100644
--- a/config/varnish64/varnish.inc
+++ b/config/varnish64/varnish.inc
@@ -51,44 +51,36 @@ function is_varnish_backend_in_use($backendname) {
function varnish_get_url_mappings_txt() {
global $g, $config, $urlmappings;
$backends = "";
-
- if($config['installedpackages']['varnishbackends']['config'] != "") {
- foreach($config['installedpackages']['varnishbackends']['config'] as $backend) {
- $isfirst = true;
- if($config['installedpackages']['varnishlbdirectors']['config'] != "") {
- foreach($config['installedpackages']['varnishlbdirectors']['config'] as $url) {
- foreach($url['row'] as $urlmapping)
- if(!$isfirst)
- $urlmappings .= "else ";
- $urlmappings .= <<<EOAU
+ $isfirst = true;
+ if($config['installedpackages']['varnishlbdirectors']['config'] != "") {
+ foreach($config['installedpackages']['varnishlbdirectors']['config'] as $url) {
+ 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;
-
- }
- }
+ $isfirst = false;
}
}
- foreach($config['installedpackages']['varnishbackends']['config'] as $urlmapping) {
- if($config['installedpackages']['varnishbackends']['config'])
- foreach($config['installedpackages']['varnishbackends']['config'] as $urlmapping) {
- if($urlmapping['row'])
- foreach($urlmapping['row'] as $url) {
- if(!$isfirst)
- $urlmappings .= "else ";
- $urlmappings .= <<<EOAU
+ if($config['installedpackages']['varnishbackends']['config'])
+ foreach($config['installedpackages']['varnishbackends']['config'] as $urlmapping) {
+ if($urlmapping['row'])
+ 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;
- }
+ $isfirst = false;
}
}
+
return $urlmappings;
}