<div>Здравствуйте.<br clear="all"></div><div>Отловил следующий баг: при проксировании не удается заменить заголовок Content-Type, если был внутренний редирект (x-accel-redirect).</div><div><br></div><div>Конфиг:</div><div>
<br></div><div><br>location = /foo/ {<br> #types { }<br> #default_type application/octet-stream; директивы не вляют<br> proxy_pass <a href="http://pushnoy.ru/resource/_audio/Pushnoy-ru_OOO_DuTaxi.mp3">http://pushnoy.ru/resource/_audio/Pushnoy-ru_OOO_DuTaxi.mp3</a>;<br>
proxy_hide_header Content-Type;<br> add_header Content-Type 'application/octet-stream';<br> }</div><div>
location = /x-accel/ {<br> proxy_pass <a href="http://return-x-accel-redirect-to-foo">http://return-x-accel-redirect-to-foo</a>;<br> }
</div><div><br></div><div>Дергаем /x-accel/ </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> HTTP/1.1 200 OK<br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Server: nginx<br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Date: Mon, 26 Dec 2011 18:04:14 GMT<br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<strong>Content-Type: text/html; charset=UTF-8</strong><br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Connection: keep-alive<br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Vary: Accept-Encoding<br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Last-Modified: Thu, 15 Apr 2010 09:32:45 GMT<br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
ETag: "3e0122-5a6c41-4bc6dd3d"<br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Accept-Ranges: bytes<br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Content-Length: 5925953<br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <strong>Content-Type: application/octet-stream</strong><br></blockquote><div>
<br></div><div><br></div><div>А если дернуть /foo/ - Ок. Директивы срабатыват ожидаемым образом.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> HTTP/1.1 200 OK<br>
</blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Server: nginx<br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Date: Mon, 26 Dec 2011 18:04:24 GMT<br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Connection: keep-alive<br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Last-Modified: Thu, 15 Apr 2010 09:32:45 GMT<br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> ETag: "3e0122-5a6c41-4bc6dd3d"<br></blockquote>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Accept-Ranges: bytes<br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Content-Length: 5925953<br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <strong>Content-Type: application/octet-stream</strong><strong><br></strong></blockquote>
<div><strong><br></strong></div><div>До кучи заголовки проксируемого файла (<a href="http://pushnoy.ru/resource/_audio/Pushnoy-ru_OOO_DuTaxi.mp3">http://pushnoy.ru/resource/_audio/Pushnoy-ru_OOO_DuTaxi.mp3</a>)</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
HTTP/1.1 200 OK<br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Date: Mon, 26 Dec 2011 18:07:48 GMT<br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Server: Apache<br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Last-Modified: Thu, 15 Apr 2010 09:32:45 GMT<br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
ETag: "3e0122-5a6c41-4bc6dd3d"<br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Accept-Ranges: bytes<br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Content-Length: 5925953<br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Keep-Alive: timeout=15, max=800<br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Connection: Keep-Alive<br></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Content-Type: audio/mpeg<br></blockquote><div><br></div><div> </div><div>nginx -V<br>
nginx: nginx version: nginx/1.1.2<br>nginx: built by gcc 4.1.2 20080704 (Red Hat 4.1.2-50)<br>nginx: TLS SNI support disabled<br>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<br>
</div><br>-- <br>С уважением, Антон