Баг с заголовком Content-Type при X-Accel-Redirect

SaveFrom.net savefrom на gmail.com
Пн Дек 26 18:16:51 UTC 2011


Здравствуйте.
Отловил следующий баг: при проксировании не удается заменить заголовок
Content-Type, если был внутренний редирект (x-accel-redirect).

Конфиг:


location = /foo/ {
   #types { }
   #default_type application/octet-stream; директивы не вляют
   proxy_pass http://pushnoy.ru/resource/_audio/Pushnoy-ru_OOO_DuTaxi.mp3;
   proxy_hide_header Content-Type;
   add_header Content-Type 'application/octet-stream';
  }
location = /x-accel/ {
  proxy_pass http://return-x-accel-redirect-to-foo;
}

Дергаем /x-accel/

> HTTP/1.1 200 OK
>
Server: nginx
>
Date: Mon, 26 Dec 2011 18:04:14 GMT
>
*Content-Type: text/html; charset=UTF-8*
>
Connection: keep-alive
>
Vary: Accept-Encoding
>
Last-Modified: Thu, 15 Apr 2010 09:32:45 GMT
>
ETag: "3e0122-5a6c41-4bc6dd3d"
>
Accept-Ranges: bytes
>
Content-Length: 5925953
>
*Content-Type: application/octet-stream*
>


А если дернуть /foo/ - Ок. Директивы срабатыват ожидаемым образом.

> HTTP/1.1 200 OK
>
Server: nginx
>
Date: Mon, 26 Dec 2011 18:04:24 GMT
>
Connection: keep-alive
>
Last-Modified: Thu, 15 Apr 2010 09:32:45 GMT
>
ETag: "3e0122-5a6c41-4bc6dd3d"
>
Accept-Ranges: bytes
>
Content-Length: 5925953
>
*Content-Type: application/octet-stream**
> *

*
*
До кучи заголовки проксируемого файла (
http://pushnoy.ru/resource/_audio/Pushnoy-ru_OOO_DuTaxi.mp3)

> HTTP/1.1 200 OK
>
Date: Mon, 26 Dec 2011 18:07:48 GMT
>
Server: Apache
>
Last-Modified: Thu, 15 Apr 2010 09:32:45 GMT
>
ETag: "3e0122-5a6c41-4bc6dd3d"
>
Accept-Ranges: bytes
>
Content-Length: 5925953
>
Keep-Alive: timeout=15, max=800
>
Connection: Keep-Alive
>
Content-Type: audio/mpeg
>


nginx -V
nginx: nginx version: nginx/1.1.2
nginx: built by gcc 4.1.2 20080704 (Red Hat 4.1.2-50)
nginx: TLS SNI support disabled
nginx: configure arguments: --conf-path=/etc/nginx/nginx.conf
--sbin-path=/usr/sbin/nginx --error-log-path=/var/log/nginx/error.log
--http-log-path=/var/log/nginx/access.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
--pid-path=/var/run/nginx.pid --user=nginx --group=nginx
--with-http_ssl_module --with-http_gzip_static_module
--with-http_stub_status_module

-- 
С уважением, Антон
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-ru/attachments/20111227/a74ca3e7/attachment.html>


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