Welcome! Log In Create A New Profile

Advanced

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

SaveFrom.net
December 26, 2011 01:18PM
Здравствуйте.
Отловил следующий баг: при проксировании не удается заменить заголовок
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

--
С уважением, Антон
_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

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

SaveFrom.net December 26, 2011 01:18PM

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

Maxim Dounin December 27, 2011 08:52AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 258
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready