On 22 Aug 2014, at 09:18, יריב הראל <[email protected]> wrote:
> Selecting backend and normalizing host header :
>
> sub vcl_recv {
> if (req.http.host == "source-qa.example.co.il" ||
> "source-qa-pp.example.co.il" || "qa.example.co.il") {
> set req.http.host = "qa.example.co.il";
> set req.backend = example_qa;
> }
> }
>
> sub vcl_recv {
> if (req.http.host == "source-qa-test.co.il" ||
> "qa-test.co.il" ) {
> set req.http.host = "qa-test.ynet.co.il";
> set req.backend = test_other_sites_qa;
> }
> }
>
> Now the problem is that when I send a request with one of the host headers
> "source-qa.example.co.il" || "source-qa-pp.example.co.il" ||
> "qa.example.co.il"
>
> The request is always sent to test_other_sites_qa which is the second
> backend and not the correct one .
Hi,
It seems the second vcl_recv subroutine is matching for every request. You
should write:
if (req.http.host == "source-qa.example.co.il" || req.http.host ==
"source-qa-pp.example.co.il" || req.http.host == "qa.example.co.il") {
...
if (req.http.host == "source-qa-test.co.il" || req.http.host =
"qa-test.co.il” ) {
...
Cheers,
—
Carlos Abalde.
signature.asc
Description: Message signed with OpenPGP using GPGMail
_______________________________________________ varnish-misc mailing list [email protected] https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
