Hello,

Hopefully a short question:

We have the following code in our VCL file:

sub vcl_recv {
    
    # Purge through http
    if (req.request == "PURGE") {
        if (!client.ip ~ purge) {
            error 405 "Not allowed.";
        }
        ban("req.url =" + req.url + "&& req.http.host =" + req.http.host);
        error 200 "Purged.";
    }

    if (req.http.cookie) {
        unset req.http.cookie;
        return (lookup);
    }
    
    if (req.http.host ~ "example.url.com") {
        set req.backend = live;
    }
    else {
        error 404 "Unkown Virtual host";
    }

When our request ( example.url.com/asdja?adn23 ) comes in we see that the
backend is selected which it first came across. We¹ve could pinpoint it to
the unset.req.http.cookie part. If we move the unset cookie part under the
req.http.host ~ "example.url.com" part it all goes fine.

Can it be that the return(lookup); in the unset req.http.cookie part skips
the req.http.host part? And thus the first backend is selected?

Thank you.

Regards,
Jaap
_______________________________________________
varnish-misc mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

Reply via email to