varnish as traffic director

AD straightflush at gmail.com
Wed Mar 30 04:52:35 CEST 2011


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: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20110329/8f05cdd3/attachment-0003.html>


More information about the varnish-misc mailing list