Home About Blog

I have special characters in my URL, how can I match them in Varnish?

If you are using special characters, for example a parentheses ), in your URL you will need to escape them with the back slash \ so Varnish will match the literal character ).

Here is an example of bypassing the cache for the URL /abc/123/x)yz in vcl_recv:

if (req.url == "/abc/123/x\)yz") {
  return (pass);