From d59adc5e18da33e14fcc299f754cdbddbbb0a3d3 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Tue, 6 Dec 2011 13:16:42 -0500 Subject: Correct backend bug when no hosts are defined as equals or regex --- config/varnish64/varnish.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'config/varnish64') diff --git a/config/varnish64/varnish.inc b/config/varnish64/varnish.inc index 7b514780..24891215 100644 --- a/config/varnish64/varnish.inc +++ b/config/varnish64/varnish.inc @@ -137,6 +137,7 @@ function varnish_get_url_mappings_txt() { #director with no host or url, so director for catch all traffic not specified in config $lasturlmappings = "\telse\t{\n\t\tset req.backend = ".$url['directorname'].";\n\t\t}\n"; $catch_all = "set"; + $isfirst = false; } else{ if(!$isfirst) @@ -149,12 +150,13 @@ function varnish_get_url_mappings_txt() { $urlfailover = "\t\t\tset req.backend = ".$url['failover'].";"; $urlmappings .= "\t\tif (req.restarts == 0) {\n".$urlbackend.$tabs.$directo_grace_time.$tabs."}"; $urlmappings .= "\n\t\telse\t{\n".$urlfailover.$tabs.$directo_grace_time.$tabs."}\n\t\t}\n"; + $isfirst = false; } else{ $tabs=($url['grace']?"\n\t\t":""); $urlmappings .= $urlbackend.$tabs.$directo_grace_time."\n\t\t}\n"; + $isfirst = false; } - $isfirst = false; } } } -- cgit v1.2.3