aboutsummaryrefslogtreecommitdiffstats
path: root/config/varnish64/varnish.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2010-04-27 13:45:16 -0400
committerScott Ullrich <sullrich@pfsense.org>2010-04-27 13:45:16 -0400
commit7ca4dcd8af8902da674135860d5ae9345be8391e (patch)
treed9e719446aa4c0ba89d69db43e759626307ff768 /config/varnish64/varnish.inc
parent101cc0b648900b72ae4b85f1b6ba8378673bf2cb (diff)
downloadpfsense-packages-7ca4dcd8af8902da674135860d5ae9345be8391e.tar.gz
pfsense-packages-7ca4dcd8af8902da674135860d5ae9345be8391e.tar.bz2
pfsense-packages-7ca4dcd8af8902da674135860d5ae9345be8391e.zip
Add backend weight for LB director
Diffstat (limited to 'config/varnish64/varnish.inc')
-rw-r--r--config/varnish64/varnish.inc9
1 files changed, 7 insertions, 2 deletions
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 .= <<<EOFA
director {$backend['directorname']} {$backend['directortype']} {
{$director}