using round-robin to redirect some traffic

Michal Taborsky - Netretail Holding michal.taborsky at
Tue Jul 13 09:30:08 CEST 2010

Dne 13.7.2010 8:03, Chris Hecker napsal(a):
> Can I use the director round-robin feature to then check the 
> req.backend with an if statement in vcl_recv, and issue a 302 (using 
> the vcl_error 750 hack) to redirect half the traffic to another 
> server?  Is there a better way to do that?
> Chris

Hello Chris,

I am not sure I understand what exactly are you trying to accomplish, 
but if you only want to have two identical servers behind your Varnish 
serving the traffic, that is a very common scenario. You just define a 
director with your servers in it and then direct your traffic to this 
director. You can choose either the random director, which allows you to 
weigh the backends and distribute the load unevenly, or the round-robin 
type, which is essentially the same as a random with equal weights.

Check out

If your needs are different (you really need to redirect to a different 
URL), please clarify.

Michal Táborský
chief systems architect
Netretail Holding, B.V.

More information about the varnish-misc mailing list