nginx - Nginx url ошибка 404 если имя файла (изображения) кириллицей?

klimovv nginx-forum at nginx.us
Sat Feb 28 13:49:06 UTC 2015


Nginx +php5-fpm wordpress
Все изображения с кириллицей (Пример: "недвижимость2-75x75.jpg") не
отображаются, выдает ошибку 404.
При добавлении новых изображений в базу, все работает нормально.
В чем может быть причина?

Лог:
2015/02/28 12:02:39 [error] 24896#0: *133 open()
"wp-content/uploads/2015/02/Обеденный-комплект-Пилар-75x75.jpg" failed (2:
No such file or directory), request: "GET
/wp-content/uploads/2015/02/%D0%9E%D0%B1%D0%B5%D0%B4%D0%B5%D0%BD%D0%BD%D1%8B%D0%B9-%D0%BA%D0%BE%D0%BC%D0%BF%D0%BB%D0%B5%D0%BA%D1%82-%D0%9F%D0%B8%D0%BB%D0%B0%D1%80-75x75.jpg
HTTP/1.1",

Настройка nginx:
server {
    listen  80;
    
    server_name 111.net www.111.net;

   
    charset utf-8;

    
    access_log  /var/log/nginx/access.log combined;
    error_log   /var/log/nginx/error.log;

   
    root /var/www/111net/data/www/111.net;

   
    gzip on;
    gzip_disable "msie6";
    gzip_static on;
  gzip_comp_level 6;
    gzip_min_length  1100;
    gzip_buffers 16 8k;
    gzip_proxied any;
    gzip_types text/plain application/xml
      application/javascript
      text/css
      text/js
      text/xml
      application/x-javascript
      text/javascript
      application/json
      application/xml+rss;

    
    client_max_body_size            100m;
    client_body_buffer_size         128k;
    client_header_timeout           3m;
    client_body_timeout             3m;
    send_timeout                    3m;
    client_header_buffer_size       1k;
    large_client_header_buffers     4 16k;

   
    location / {
        
        root /var/www/111net/data/www/111.net;

        
        index  index.php index.html index.htm;     

        
        try_files $uri $uri/ @fallback;
    }

    
    location @fallback {
        rewrite  ^(.*)$ /index.php?$args last;
    }

    
    location ~* \.(jpeg|ico|jpg|gif|png|css|js|pdf|txt|tar|gz|wof|csv|zip)
{
        access_log off;
    
        try_files $uri @statics;
        expires 14d;
        add_header Access-Control-Allow-Origin *;
        add_header Cache-Control public;
        root /var/www/111net/data/www/111.net;
    }

    
    location @statics {
        rewrite ^/(\w+)/(.*)$ /$2 break;
        access_log off;
        rewrite_log off;
        expires 14d;
        add_header Cache-Control public;
        add_header Access-Control-Allow-Origin *;
        root /var/www/111net/data/www/111.net;
    }

    
    location ~ \.php$ {
        root /var/www/111net/data/www/111.net;
        proxy_read_timeout 61;
        fastcgi_read_timeout 61;
        try_files $uri $uri/ =404;
        #   Путь до сокета демона PHP-FPM
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }


    location /images/ {
        allow all;
        location ~* \.([pP][hH][pP].?)$ {
            deny all;
        }
    }

   
    location /var/ {
        deny all;
        location ~* \.(js|css|png|jpg|gz)$ {
            allow all;
            expires 1M;
            add_header Cache-Control public;
            add_header Access-Control-Allow-Origin *;
        }
    }
 
}

Posted at Nginx Forum: http://forum.nginx.org/read.php?21,256953,256953#msg-256953



Подробная информация о списке рассылки nginx-ru