From 7ca4dcd8af8902da674135860d5ae9345be8391e Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Tue, 27 Apr 2010 13:45:16 -0400 Subject: Add backend weight for LB director --- config/varnish64/varnish.inc | 9 +++++++-- config/varnish64/varnish_lb_directors.xml | 6 ++++++ 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'config/varnish64') diff --git a/config/varnish64/varnish.inc b/config/varnish64/varnish.inc index d21245d8..026f602c 100644 --- a/config/varnish64/varnish.inc +++ b/config/varnish64/varnish.inc @@ -197,8 +197,13 @@ EOFA; 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}"; + foreach($backend['row'] as $be) { + if($be['weight']) + $weight = "\n\t\t\t.weight = {$be['weight']};\n" + else + $weight = ""; + $director .= "\t{\n\t\t.backend = {$be['backendname']};\n{$weight}\t}"; + } $backends .= <<backendname select_source + + Weight + weight + Enter the weight of this backend. + input + -- cgit v1.2.3