image_filter and then save it for cache

smoothdvd nginx-forum at
Thu Dec 9 10:19:52 MSK 2010

I want to keep image_filter's result to harddrive, and any one can help
me to do it? Now I can only resize the original image.

Following code only does resize.

# image resize
location /pic {
root /Users/alexgao/linux/web/;
try_files $uri @resize_pic;

location @resize_pic {
root /Users/alexgao/linux/web/;
if ($request_filename ~ [a-zA-Z0-9\-]+_([0-9]+)x([0-9]+).jpg) {
set $img_width $1;
set $img_height $2;
rewrite ^(.*)_[0-9]+x[0-9]+.jpg$ $1.jpg break;
image_filter resize $img_width $img_height;
image_filter_buffer 1M;
proxy_store on;
proxy_store_access user:rw group:rw all:rw;
proxy_temp_path /Users/alexgao/linux/web/;

Posted at Nginx Forum:,157065,157065#msg-157065

More information about the nginx mailing list