Welcome! Log In Create A New Profile

Advanced

Re: image filter + proxy store

October 13, 2012 05:28PM
tzirulnicov Wrote:
-------------------------------------------------------
> Хочется силами nginx делать превьюшки, только если они ранее не
> делались.
>
> server{
> listen 81;
> server_name www.***.ru ***.ru;
> root /home/site_path/htdocs;
>
> location ~ ^/img_path/.*\.(?:jpg|jpeg|gif|png)_small1.jpeg$ {
> rewrite ^/img_path/(.*)_small1.jpeg$ /ee/wwfiles/$1;
>
> break;
> }
> }
>
>
> server{
> listen 80;
> ...
> location ~ ^/img_path/.*\.(?:jpg|jpeg|gif|png)_small1.jpeg$ {
> proxy_pass http://127.0.0.1:81;
> proxy_set_header Host $host;
>
> proxy_store on;
> proxy_store_access user:rw group:rw all:r;
> proxy_temp_path /home/img_cache_path;
> root /home/img_cache_path;
> }
> }
>
> - кэш не работает, превьюшка создаётся заново при каждом запросе и
> сохраняется в /home/img_cache_path;
> Почему? Как сделать сохранение превьюшек, созданных при помощи image
> filter?

Попробуй примерно вот так:

location ~ ^/img_path/.*\.(?:jpg|jpeg|gif|png)_small1.jpeg$ {
root /home/img_cache_path;
try_files $uri /create_image$uri
}

location ~ ^/img_cache_path/img_path/.*\.(?:jpg|jpeg|gif|png)_small1.jpeg$ {
internal;
root /home;
proxy_pass http://127.0.0.1:81;
image_filter resize - 81;
proxy_set_header Host $host;

proxy_store on;
proxy_store_access user:rw group:rw all:r;
proxy_temp_path /home/img_cache_path;
}
Subject Author Posted

image filter + proxy store

tzirulnicov October 13, 2012 04:59PM

Re: image filter + proxy store

Priority1 October 13, 2012 05:28PM

Re: image filter + proxy store

tzirulnicov October 14, 2012 07:18AM

Re: image filter + proxy store

tzirulnicov October 14, 2012 08:43AM

Re: image filter + proxy store

VBart October 14, 2012 07:46AM

Re: image filter + proxy store

tzirulnicov October 14, 2012 08:48AM

Re: image filter + proxy store

Михаил Панфилов October 14, 2012 10:20AM

Re: image filter + proxy store

VBart October 14, 2012 10:48AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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