aboutsummaryrefslogtreecommitdiffstats
path: root/config/varnish64
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2010-04-27 13:15:55 -0400
committerScott Ullrich <sullrich@pfsense.org>2010-04-27 13:15:55 -0400
commit711076df184128e242c7d4f8c38e09a8fd40486d (patch)
treeb2bed99f117923c2e2e9b4ff81b043674ee11d21 /config/varnish64
parent49a83ffa474d7122732a3b98630cb034b31857e8 (diff)
downloadpfsense-packages-711076df184128e242c7d4f8c38e09a8fd40486d.tar.gz
pfsense-packages-711076df184128e242c7d4f8c38e09a8fd40486d.tar.bz2
pfsense-packages-711076df184128e242c7d4f8c38e09a8fd40486d.zip
Varnish is now starting OK
Diffstat (limited to 'config/varnish64')
-rw-r--r--config/varnish64/varnish.inc49
1 files changed, 24 insertions, 25 deletions
diff --git a/config/varnish64/varnish.inc b/config/varnish64/varnish.inc
index 70425409..1ec000e7 100644
--- a/config/varnish64/varnish.inc
+++ b/config/varnish64/varnish.inc
@@ -99,29 +99,12 @@ synthetic {"
</body>
</html>
"};
-deliver;
+return(deliver);
EOF;
$backends = "";
$urlmappings = "";
-
- if($config['installedpackages']['varnishlbdirectors']['config'] != "") {
- foreach($config['installedpackages']['varnishlbdirectors']['config'] as $backend) {
- $director = "";
- if($backend['row'])
- foreach($backend['row'] as $be)
- $director .= "\t{\n\t\t.backend = {$be['backendname']};\n\t}";
- $backends .= <<<EOFA
-director {$backend['directorname']} {$backend['directortype']} {
-{$director}
-}
-
-
-EOFA;
- }
- }
-
if($config['installedpackages']['varnishbackends']['config'] != "") {
foreach($config['installedpackages']['varnishbackends']['config'] as $backend) {
@@ -133,7 +116,7 @@ EOFA;
$urlmappings .= "else ";
$urlmappings .= <<<EOAU
if (req.http.host == "{$url['directorurl']}") {
- set req.backend = "{$url['directorname']}";
+ set req.backend = {$url['directorname']};
set req.http.host = "{$url['directorurl']}";
}
EOAU;
@@ -149,7 +132,7 @@ EOAU;
$urlmappings .= "else ";
$urlmappings .= <<<EOAU
if (req.http.host == "{$url['urlmapping']}") {
- set req.backend = "{$urlmapping['backendname']}";
+ set req.backend = {$urlmapping['backendname']};
set req.http.host = "{$urlmapping['urlmapping']}";
}
EOAU;
@@ -162,25 +145,41 @@ EOAU;
else
$connect_timeout = "25s";
if($backend['port'])
- $connect_timeout = $backend['port'];
+ $connect_timeout = $backend['port'] . "s";
else
$connect_timeout = "80";
if($backend['first_byte_timeout'])
- $first_byte_timeout = $backend['first_byte_timeout'];
+ $first_byte_timeout = $backend['first_byte_timeout'] . "s";
else
$first_byte_timeout = "300s";
$backends .= <<<EOFA
backend {$backend['backendname']} {
.host = "{$backend['ipaddress']}";
.port = "{$backend['port']}";
- .first_byte_timeout = "{$first_byte_timeout}";
- .connect_timeout = "{$connect_timeout}";
+ .first_byte_timeout = {$first_byte_timeout};
+ .connect_timeout = {$connect_timeout};
}
EOFA;
}
}
+ if($config['installedpackages']['varnishlbdirectors']['config'] != "") {
+ foreach($config['installedpackages']['varnishlbdirectors']['config'] as $backend) {
+ $director = "";
+ if($backend['row'])
+ foreach($backend['row'] as $be)
+ $director .= "\t{\n\t\t.backend = {$be['backendname']};\n\t}";
+ $backends .= <<<EOFA
+director {$backend['directorname']} {$backend['directortype']} {
+{$director}
+}
+
+
+EOFA;
+ }
+ }
+
if($vcl_fetch_early or $vcl_fetch_late) {
$vcl_fetch = <<<FETCH
sub vcl_fetch {
@@ -229,7 +228,7 @@ sub vcl_recv {
{$urlmappings}
{$vcl_recv_custom_late}
if (req.request != "GET" && req.request != "HEAD") {
- pipe;
+ return(pipe);
}
return(lookup);
}