diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2010-04-27 19:56:38 -0400 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2010-04-27 19:56:47 -0400 |
commit | e2bdf0c49f41f239379cc5047170b398e4ef48f9 (patch) | |
tree | fb64cbb482e1f4ebb06069949fb7fe9e9957fba0 /config/varnish64/varnish.inc | |
parent | 883feaf113a72b2c940be0012d2df1b4abc0c293 (diff) | |
download | pfsense-packages-e2bdf0c49f41f239379cc5047170b398e4ef48f9.tar.gz pfsense-packages-e2bdf0c49f41f239379cc5047170b398e4ef48f9.tar.bz2 pfsense-packages-e2bdf0c49f41f239379cc5047170b398e4ef48f9.zip |
Add vcl_recv field
Diffstat (limited to 'config/varnish64/varnish.inc')
-rw-r--r-- | config/varnish64/varnish.inc | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/config/varnish64/varnish.inc b/config/varnish64/varnish.inc index e99e90c1..dc343a44 100644 --- a/config/varnish64/varnish.inc +++ b/config/varnish64/varnish.inc @@ -35,6 +35,10 @@ function sync_package_varnish() { global $config, $g; if($config['installedpackages']['varnishcustomvcl']['config'] != "") { foreach($config['installedpackages']['varnishcustomvcl']['config'] as $vcl) { + if($vcl['vcl_recv_early']) + $vcl_recv_early = $vcl['vcl_recv_early']; + if($vcl['vcl_recv_late']) + $vcl_recv_late = $vcl['vcl_recv_late']; if($vcl['vcl_fetch_early']) $vcl_fetch_early = $vcl['vcl_fetch_early']; if($vcl['vcl_fetch_late']) @@ -139,16 +143,18 @@ EOAU; 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($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; + } } } @@ -246,7 +252,7 @@ sub vcl_error { {$backends} sub vcl_recv { - {$vcl_recv_custom_early} + {$vcl_recv_early} # If the client sent an X-Forwarded-For header, remove it. # It cannot betrusted. unset req.http.X-Forwarded-For; @@ -270,7 +276,7 @@ sub vcl_recv { } } {$urlmappings} - {$vcl_recv_custom_late} + {$vcl_recv_late} if (req.request != "GET" && req.request != "HEAD") { return(pipe); } |