1

I have a client, which needs Varnish to be installed on his server. He is russian speaking and has an online shop with the following example URL, which needs to be excluded from cache (корзина is the cart page).

www.example.com/корзина/

So, is there any special way of using non latin characters in VCL, as it seems not to work for me. I tried the following (actual code is longer than that and working for other web pages, this is just to show you an example):

if (
! req.url ~ "(...|корзина/|...)"
# or URLencoded:
! req.url ~ "(...|%D0%BA%D0%BE%D1%80%D0%B7%D0%B8%D0%BD%D0%B0/|...)"
)
{ unset req.http.cookie; }

Both seem to not work for me somehow - my rules are not triggered. So, how should I use non latin characters in VCL?

0

Yes, sadly, I need to answer my own question, sorry for that :)

Non latin characters in an URL must be encoded AND lower case. So this will work:

req.url ~ "(...|%d0%ba%d0%be%d1%80%d0%b7%d0%b8%d0%bd%d0%b0|...)" ...

This won't:

req.url ~ "(...|%D0%BA%D0%BE%D1%80%D0%B7%D0%B8%D0%BD%D0%B0/|...)" ...
req.url ~ "(...|корзина/|...)" ...

How I found out? I used a magic tool, called varnishlog :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.