Varnish - set backend if statuscode is 404

Tobias Honacker t.honacker at googlemail.com
Wed Nov 27 11:35:22 CET 2013


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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20131127/46e6cf25/attachment.html>


More information about the varnish-misc mailing list