A
A
Alexander2021-06-26 15:39:15
Nginx
Alexander, 2021-06-26 15:39:15

Why do Cyrillic paths to static files crash when nginx caching is enabled?

An interesting situation arose with the caching setting in nginx
. In general, I include the standard config

location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|woff|woff2)$ {
          expires 6M;
          access_log off;
          log_not_found off;
          add_header Cache-Control "public";
        }

And pictures that have Cyrillic on the way fall off, I get a 404 response
I did not force transliteration, and the client threw all sorts of nonsense, created folders with Cyrillic names and spaces
And threw pictures like Screenshot5.jpg
And now with caching enabled, I get a 404
error Is it possible to somehow adjust the server or just remake the pictures?
PS It seems that only long paths fall off, for example
https://domainname.com/media/cache/resolve/nano/uploads/cars/%25D0%25A1%25D0%25BD%25D0%25B8%25D0%25BC%25D0%25BE%25D0%25BA%2520%25D1%258D%25D0%25BA%25D1%2580%25D0%25B0%25D0%25BD%25D0%25B0%25202021-04-12%2520170245.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question