Can you please explain a bit more what advantage I will have by using return(pass). Are you saying if I use return(pipe) then the client's subsequent request will start getting 404 Error?
My intention is if the header req.http.Type == "p" then i want to treat as if varnish is not present for those requests and the request going straight to backend. On Thu, May 19, 2016 at 4:41 PM, Dridi Boukelmoune <[email protected]> wrote: > On Thu, May 19, 2016 at 10:16 AM, Debraj Manna <[email protected]> > wrote: > > Hi, > > > > We are using varnish for multiple round robin backends. as shown below:- > > > > backend d1 { > > .host = "172.16.84.69"; > > .port = "9802"; > > } > > backend d2 { > > .host = "172.16.84.68"; > > .port = "9802"; > > } > > backend r1 { > > .host = "172.16.84.69"; > > .port = "9802"; > > } > > backend r2 { > > .host = "172.16.84.68"; > > .port = "9802"; > > } > > You don't need to duplicate backend definitions, your directors d and > r can share two backends b1 and b2. > > Can some one please let me know if the below code is the best way to > > achieve what I am trying to do? > > if(req.http.Type == "p") { > > req.backend_hint = r.backend(); > > return (pipe); > > } > > It looks OK but if your client sends subsequent HTTP requests, Varnish > won't see them after a return(pipe). You may use return(pass) instead, > to bypass Varnish for individual requests. > > Dridi >
_______________________________________________ varnish-misc mailing list [email protected] https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
