Reputation: 1915
I have been struggling to match this url pattern in varnish 3 vcl
www.example.com/alpha/76/Permanent/
if ((req.url ~ "/*/*/Permanent/$")) {
set beresp.http.Cache-Control = "public, max-age=1400, s-maxage=1400";
set beresp.ttl = 30m;
return(deliver);
}
but it seems not to match the condition. Any idea where I am wrong?
Upvotes: 1
Views: 555
Reputation: 138017
/*
means zero or more slashes (this is not glob). You should use:
^/\w+/\w+/Permanent/$
\w+
would match one or more alphanumeric characters.
Source: VCL Regex cheat-sheet - Matching with wildcards
Upvotes: 1