varnish as traffic director

Jonathan Leibiusky ionathan at gmail.com
Wed Mar 30 05:01:13 CEST 2011


Thanks!
If I have 100 of different rules, I would have a very big if block, right?
Is this a common use case for varnish?


On Tue, Mar 29, 2011 at 11:52 PM, AD <straightflush at gmail.com> wrote:

> sub vcl_recv {
>
>   if (req.url ~ "^/search") {
>     set req.backend = search-backend;
>   }
>   elseif (req.url ~ "^/items") {
>     set req.backend = items-backend;
>   }
>
> }
>
> On Tue, Mar 29, 2011 at 10:43 PM, Jonathan Leibiusky <ionathan at gmail.com>wrote:
>
>> hi! is there any way to use varnish to direct my traffic to different
>> backends depending on the requested url?
>> so for example I would have 2 different backends:
>> - search-backend
>> - items-backend
>>
>> if the requested url is /search I want to direct the traffic to
>> search-backend
>> and if the requested url is /items I want to direct the traffic to
>> items-backend
>>
>> is this a common use case for varnish or I am trying to accomplish
>> something that should be done using something else?
>>
>> thanks!
>>
>> jonathan
>>
>> _______________________________________________
>> varnish-misc mailing list
>> varnish-misc at varnish-cache.org
>> http://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20110330/4d05ba5c/attachment.html>


More information about the varnish-misc mailing list