T
T
Test Test2015-05-04 12:58:25
Nginx
Test Test, 2015-05-04 12:58:25

Why doesn't nginx return files with Russian letters?

Good afternoon! After migrating the site to Nginx, I noticed such a problem that my site does not give files with Russian letters. Do not tell me how to deal with this?
config snippet:

# set expiration of assets to MAX for caching
    location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
         expires max;
         log_not_found off;
         #add_header Cache-Control public;
         #add_header Access-Control-Allow-Origin *;
    }

When accessing a file with Russian letters, it gives 404, and these are the headers:
Request URL: http://stat.site.ru/gallery/%D0%A1%D0%BF%D0%B0%D1%81%D1%81%D0%BA%D0%B0%D1%8F_%D0%B1%D0%B0%D1%88%D0%BD%D1%8F_21.jpg
Request Method: GET
Status Code: 404 Not Found

Connection: keep-alive
Content-Encoding: gzip
Content-Type: text/html; charset=utf-8
Date: Mon, 04 May 2015 09:51:08 GMT
Server: nginx/1.4.6 (Ubuntu)
Transfer-Encoding: chunked

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding: gzip, deflate, sdch
Accept-Language: ru,en;q=0.8
Cache-Control: no-cache
Connection: keep-alive
Host: stat.site.ru
Pragma: no-cache
User-Agent:Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 YaBrowser/15.4.2272.3429 Safari/537.36

Logs have entries:
2015/05/04 09:57:09 [info] 1322#0: *221 client *.*.253.87 closed keepalive connection
2015/05/04 09:57:14 [info] 1322#0: *225 client *.*.25.139 closed keepalive connection

Other files give normally.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SimWhite, 2015-05-04
@SimWhite

For starters, I recommend getting rid of the Cyrillic alphabet and bringing all file names back to normal, without Russian code pages. You can try to get around the problem by setting the system code page to UTF-8, renaming the files to UTF-8, giving the page explicitly indicating that you have UTF-8. Thus, you minimize the number of errors. For a complete solution, I repeat, get rid of Russian file names.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question