Return Lookup

Jaap van Arragon j.vanarragon at lukkien.com
Wed Nov 23 12:32:00 CET 2011


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 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20111123/c3e7703f/attachment-0003.html>


More information about the varnish-misc mailing list