diff options
Diffstat (limited to 'config/varnish64')
-rw-r--r-- | config/varnish64/varnish.inc | 9 | ||||
-rw-r--r-- | config/varnish64/varnish_lb_directors.xml | 6 |
2 files changed, 13 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} diff --git a/config/varnish64/varnish_lb_directors.xml b/config/varnish64/varnish_lb_directors.xml index d67327fa..454d8768 100644 --- a/config/varnish64/varnish_lb_directors.xml +++ b/config/varnish64/varnish_lb_directors.xml @@ -134,6 +134,12 @@ <source_value>backendname</source_value> <type>select_source</type> </rowhelperfield> + <rowhelperfield> + <fielddescr>Weight</fielddescr> + <fieldname>weight</fieldname> + <description>Enter the weight of this backend.</description> + <type>input</type> + </rowhelperfield> </rowhelper> </field> </fields> |