415 Unsupported Media Type with image_filter

Eugene Prokopiev enp на itx.ru
Чт Авг 4 14:26:09 UTC 2016


Здравствуйте!

Требуется проксировать и обрезать картинки, пытаюсь делать так:

server {
    listen 80;
    server_name localhost;
    location / {
        proxy_pass https://a2.muscache.com;
        image_filter crop 600 600;
        image_filter_buffer 1000M;
    }
}

Не получается:

$ curl -I -X HEAD http://localhost/im/pictures/85355503/64baa390_original.jpg
HTTP/1.1 415 Unsupported Media Type
Server: nginx
Date: Thu, 04 Aug 2016 14:13:25 GMT
Content-Type: text/html
Content-Length: 188
Connection: keep-alive

$ curl -I -X HEAD
https://a2.muscache.com/im/pictures/85355503/64baa390_original.jpg
HTTP/1.1 200 OK
Content-Type: image/jpeg
Access-Control-Expose-Headers: Content-Length
Last-Modified: Wed, 03 Aug 2016 20:10:22 UTC
X-IM2G-Akamai-Auth-Sign: QrDvx1Ja1CBCCDSGijz9Bvfccnivnuz1SYwAlbFdRaw=
X-IM2G-Akamai-Auth-Data: salt=2197993113278415406 parse=1 adapted=1
Server: Akamai Image Manager
Content-Length: 44548
Cache-Control: private, max-age=43200
Expires: Fri, 05 Aug 2016 02:15:35 GMT
Date: Thu, 04 Aug 2016 14:15:35 GMT
Connection: keep-alive
access-control-allow-methods: GET
access-control-allow-origin: *

Однако не получается не всегда, одна и та же картинка может нормально
проксироваться - и как правило так и происходит.

В error.log вообще ничего даже с debug (и на собранном с --debug nginx
соответственно). Вообще nginx собран так:

# nginx -V
nginx version: nginx/1.10.1
built with OpenSSL 1.0.2h  3 May 2016
TLS SNI support enabled
configure arguments: --prefix=/ --conf-path=/etc/nginx/nginx.conf
--sbin-path=/usr/sbin --modules-path=/usr/lib64/nginx
--error-log-path=/var/log/nginx/nginx.error.log
--http-log-path=/var/log/nginx/nginx.log
--http-client-body-temp-path=/var/spool/nginx/tmp/client
--http-proxy-temp-path=/var/spool/nginx/tmp/proxy
--http-fastcgi-temp-path=/var/spool/nginx/tmp/fastcgi
--http-uwsgi-temp-path=/var/spool/nginx/tmp/uwsgi
--http-scgi-temp-path=/var/spool/nginx/tmp/scgi
--pid-path=/var/run/nginx.pid --user=_nginx --group=_nginx
--with-cc-opt='-I /usr/include/pcre/' --with-http_ssl_module
--with-select_module --with-poll_module --with-threads --with-file-aio
--with-ipv6 --with-http_ssl_module --with-http_v2_module
--with-http_realip_module --with-http_addition_module
--with-http_xslt_module=dynamic
--with-http_image_filter_module=dynamic
--with-http_geoip_module=dynamic --with-http_sub_module
--with-http_dav_module --with-http_flv_module --with-http_mp4_module
--with-http_gunzip_module --with-http_gzip_static_module
--with-http_auth_request_module --with-http_random_index_module
--with-http_secure_link_module --with-http_degradation_module
--with-http_slice_module --with-http_stub_status_module
--with-http_perl_module=dynamic --with-mail=dynamic
--with-mail_ssl_module --with-stream=dynamic --with-stream_ssl_module
--add-module=cache_purge --add-module=nginx-rtmp-module --with-debug
--with-google_perftools_module --with-md5=/usr/lib64
--with-sha1=/usr/lib64

Как диагностировать и лечить?

-- 
WBR,
Eugene Prokopiev



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