Varnish - set backend if statuscode is 404

Per Buer perbu at varnish-software.com
Wed Nov 27 16:17:56 CET 2013


Hi Tobias.

Check the status in vcl_fetch. If it is then enable saint mode and call
restart. Make sure saintmode_threshold is 0 so it wont disable a backend
based on the number of 404s.


Per.


On Wed, Nov 27, 2013 at 11:35 AM, Tobias Honacker <t.honacker at googlemail.com
> wrote:

> Hey guys,
>
> i’ve got one problem and don’t know how to solve this problem.
> I have to use another backend if the req.url matches AND HTTP Status is
> 404.
>
> sub vcl_recv {
> if (req.url ~ „^/path/to/images") {
>  set req.backend = p1_backend;
>  set req.http.host = "www.mysite.de“;
>  }
>
> How to solve the 404 Status?
>
>
> varnishd -V
> varnishd (varnish-3.0.2 revision 55e70a4)
> Copyright (c) 2006 Verdens Gang AS
> Copyright (c) 2006-2011 Varnish Software AS
>
>
> Thanks for any information.
>
>
> Best regards,
> Tobias
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>



-- 
 <http://www.varnish-software.com/> *Per Buer*
CTO | Varnish Software AS
Phone: +47 958 39 117 | Skype: per.buer
We Make Websites Fly!

Winner of the Red Herring Top 100 Europe Award 2013
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20131127/98bb8d27/attachment.html>


More information about the varnish-misc mailing list