天天看點

動态縮略圖方案

自建nginx 圖檔伺服器,安裝image_filter 子產品

server {

listen 80;

server_name img.imwinlion.com;

index index.html index.htm index.php;

root /alidata/mnt/imwinlion;

location ~ .*\.(php|php5)?$

{

fastcgi_pass 127.0.0.1:9000;

fastcgi_index index.php;

include fastcgi.conf;

}

location ~ (.*)\.(gif|jpg|jpeg|png|PNG|JPG|JPEG)\!(\d+)x(\d+)$

{

try_files $1.$2 /empty last;

image_filter_interlace on;

image_filter_jpeg_quality 90;

image_filter resize $3 $4;

image_filter_buffer 3M;

}

location ~ .*\.(gif|jpg|JPG|PNG|GIF|BMP|jpeg|png|bmp|swf)$

{

expires 30d;

}

location ~ .*\.(js|css)?$

{

expires 1h;

}

access_log /dev/null;

}

轉載于:https://www.cnblogs.com/web21/p/7514955.html