Can Varnish do this?

zabrane Mikael zabrane3 at gmail.com
Wed Jul 7 16:49:42 CEST 2010


Hi again,



> You'd write something like:
> backend normalhttp { .host = "a.b.c.d"; .port="80"; }
> backend customserver { .host = "w.x.y.z"; .port="80"; }
>
> sub vcl_recv {
>
>   // Set the default backend:
>   set req.backend = normalhttp;
>
>   // But override it if this is a request containing X-RAWDATA
>   if (req.http.X-RAWDATA!="") {
>       set req.backend = customserver;
>   }
>   ...
>
> This code above isn't tested, but we use a similar approach happily in
> production.  We inspect the http host, and redirect certain hosts to
> different backend director pools.
>

Believe it or not, the solution works "like a charm" !!!


Regards
Zab
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20100707/8cd3d51a/attachment-0003.html>


More information about the varnish-misc mailing list