Никита Кардашин
April 15, 2010 09:50PM
А кто обрабатывает PHP-то? fastcgi? apache? Вы ему этот файл передаете
(proxy_pass\fastcgi_pass)?



16.04.10, grigory<nginx-forum@nginx.us> написал(а):
> Всем привет.
>
> Я включил на nginx кеширование proxy_cache, но хочу, чтобы у меня не
> кешировались запросы вида:
> location ~* ^/download { }, т.к. по этой ссылке пользователю скачивается
> картинка следующим образом:
>
> header("Content-Type: image/" . $ext);
> header("Content-Length: " . (string)filesize($path_to_image));
> header("Content-Disposition: attachment; filename=domain.com_" . $pic_id .
> "." . $ext);
> header("Content-Transfer-Encoding: binary\n");
> readfile($image);
>
> Если я не добавляю в конфиг этот location ~* ^/download { }, то всё
> прекрасно работает, но nginx кеширует эти картинки, а этого делать не нужно.
> Когда же я добавляю location ~* ^/download { proxy_cache off; }, то по
> ссылке перестают выдаваться картинки, а выдаётся на скачку сам .php-скрипт.
>
> Как исправить ситуацию?
>
> P.S.: Картинки разного формата -- gif, jpg, png, bmp., что определяется
> параметром $ext при GET-запросе.
>
> Posted at Nginx Forum:
> http://forum.nginx.org/read.php?21,75571,75571#msg-75571
>
>
> _______________________________________________
> nginx-ru mailing list
> nginx-ru@nginx.org
> http://nginx.org/mailman/listinfo/nginx-ru
>


--
With best regards,
differentlocal (www.differentlocal.ru | differentlocal@gmail.com),
System administrator.
_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

Re: proxy cache + закачка файла

Никита Кардашин April 15, 2010 09:50PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 309
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