You could try with two backends named app1 and app2 and app_dir as the default
director
if (req.http.X-AppServer == "app1") {
set req.backend = app1;
} else if (req.http.X-AppServer == "app2") {
set req.backend = app2;
} else {
set req.backend = app_dir;
}
________________________________
From: Rafał Radecki <[email protected]>
To: [email protected]
Sent: Friday, January 11, 2013 4:16 AM
Subject: Varnish 3 - choose backend based on header field.
Hi all.
I currently use varnish 3 in my environment. I use client director
with two backends. I use set client.identity = client.ip to connect
client session with backend.
I would like to have the possibility to choose specific backend (first
or second) based on the presence of a header in http request. If my
request would have a header X-AppServer = app1 varnish should forward
the request to the first application server if X-AppServer = app2 to
the second and if there would be no such header it should use default
client director. Is it possible in varnish 3?
Best regards,
Rafal.
_______________________________________________
varnish-misc mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc_______________________________________________
varnish-misc mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc