Using Varnish to Proxy 1000s of different sites

Tony Primerano tony.primerano at gmail.com
Thu Aug 5 18:21:07 CEST 2010


On Thu, Aug 5, 2010 at 10:50 AM, Per Buer <perbu at varnish-software.com>wrote:

> On Thu, Aug 5, 2010 at 4:33 PM, Tony Primerano <tony.primerano at gmail.com>
> wrote:
> > (..)
> > But what if I have 1000s of backends and I choose them based on the
> domain
> > that user's hit varnish with.   Is this something Varnish handles or is
> it
> > only intended to work with a handful of backends?
>
> It's not built for that.  Kristians dns director might help you out a
> bit, but it just entered trunk (will be in 2.1.4).
>

http://kristianlyng.wordpress.com/2010/08/02/varnish-backend-selection-through-dns/

Looks promising but in the end I think I end up with the same amount of
code. (a vcl_fetch with 1000s of ifs)

Some clarification on what I am trying to do..  without code samples ;-)

All traffic to foo.com should go to bar.com (update Host header and open
connection to bar.com)
All traffic to some.food.com should go to meal.com (update Host header and
open connection to meal.com)

repeat for 1000 domains and or subdomains.

I'm just allowing bar.com content to show on foo.com without modifying
foo.com's virtual host configurations.



> > Also, it would be really cool if I could do something like this..
> > sub vcl_recv {
> >   set req.http.host = "example.com";
> >   set req.backend.host  = req.http.host;
> >   return(pass);
> > }
>
> That would be an open proxy. Spammers bonanza. Please don't do that. :-)
>
> If you still want to do it you could have a look at
>
> http://ingvar.blog.linpro.no/2010/05/26/accelerating-the-internet-or-actually-squid-with-varnish/
>
> and use a non-caching proxy in stead of squid. That would work.
>
>
>
> --
> Per Buer,  Varnish Software
> Phone: +47 21 98 92 61 / Mobile: +47 958 39 117 / skype: per.buer
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20100805/269d42da/attachment-0003.html>


More information about the varnish-misc mailing list