Varnish round robin using Director

Tharanga Abeyseela tharanga.abeyseela at gmail.com
Thu Aug 29 12:57:47 CEST 2013


Hi Guys,

I'm trying to load-balance requests between two servers. i have the
following config.

backend website {
    .host = "xxx.com";
    .port = "8080";
   .probe = {
    .url = "/favicon.ico";
    .timeout = 60ms;
    .interval = 60s;
    .window = 5;
    .threshold = 3;
}
}
backend api {
    .host = "yyy.com";
    .port = "8080";
   .probe = {
    .url = "/favicon.ico";
    .timeout = 60ms;
    .interval = 60s;
    .window = 5;
    .threshold = 3;
}
}

sub vcl_recv {
if ( req.url ~ "/api/") {
set req.backend = api;
set req.http.host = "yyyy.com";
} else {
set req.backend = website;
}
}

director clust round-robin {
{ .backend = website; }
{ .backend = api; }
}

but this is giving the following error.

Unused backend clust, defined:
('input' Line 39 Pos 10)
director clust round-robin {
---------#####--------------

then i was tyring to add set req.backend = clust (then it is giving the
error,

Symbol not found: 'clust' (expected type BACKEND):

am i missing something here.

Cheers,
Tharanga
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20130829/252e0ff8/attachment.html>


More information about the varnish-misc mailing list