Вопрос снят, это я сам text/plain и content-length 0 ставил, поэтому nginx ничего не менял :)<br><br><div class="gmail_quote">16 декабря 2008 г. 16:02 пользователь Анатолий Шарифулин <span dir="ltr">&lt;<a href="mailto:sharifulin@tochkak.ru">sharifulin@tochkak.ru</a>&gt;</span> написал:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Привет!<br><br>Есть контент вида image.jpg, video.mp4, разложенный по папочкам с ID:<br><br>
ID/<br>&nbsp;&nbsp; image.jpg<br>&nbsp;&nbsp; video.mp4<br>&nbsp;&nbsp; ...<br>ID2/<br>&nbsp;&nbsp; image.jpg<br>&nbsp;&nbsp; video.mp4<br>&nbsp;&nbsp; ...<br>...<br>&nbsp;&nbsp; <br>Контент раздает nginx, нужно при скачке таких файлов отдавать &quot;нормальные&quot; названия.<br>
<br>Сделал так:<br><br>&nbsp;&nbsp;&nbsp; location / {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if ($args ~* test) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; proxy_pass <a href="http://domain:9999" target="_blank">http://domain:9999</a>;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; break;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; expires max;<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; root /path/data;<br>&nbsp;&nbsp;&nbsp; }<br clear="all"><br>На порту 9999 (на другом сервере) висит демона, который для каждой ID находит &quot;нормальные&quot; названия и отвечает на каждый запрос так:<br><br>200 OK<br>Server: Title Server/1.0<br>

Content-Type:<br>Content-Disposition: attachment; filename=&quot;normalnoe_nazvanie.mp4&quot;<br>X-Accel-Redirect: /data/1133/video.mp4<br><br>Далее запрос обрабатывает nginx:<br><br>&nbsp;&nbsp;&nbsp; location /data/ {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; internal;<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; expires max;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; root /path;<br>&nbsp;&nbsp;&nbsp; }<br><br>В результате пользователь получает следующий ответ:<br><br>200 OK<br>Server: nginx/0.6.16<br>Date: Tue, 16 Dec 2008 12:44:24 GMT<br>Content-Type: text/plain; charset=utf-8<br>

Last-Modified; Fri, 12 Dec 2008 10:02:45 GMT<br>Transfer-Encoding: chunked<br>Content-Disposition: attachment; filename=&quot;normalnoe_nazvanie.mp4&quot;<br>Content-Encoding: gzip<br>Connection: Close<br><br>Т.е. ставится дефолтный Content-Type, а должен от отдающего файла, и нет Content-Length.<br>

Как разрешить эту проблему?<br><br>Сначала была идея написать на nginx-perl, но у меня демон общается с БД не блокируясь. Поэтому решил написать свой демон.<br><br>-- <br>С уважением,<br><font color="#888888"> Анатолий Шарифулин.<br>

</font></blockquote></div><br><br clear="all"><br>-- <br>С уважением,<br> Анатолий Шарифулин.<br>