作者:湘刘涛 | 来源:互联网 | 2018-03-20 12:15
nginx动态缩略图//ubuntu 需要apt-get -y install libgd2-xpm-dev build-essential
//在图片后边加上!100!100就可以访问缩略图127.0.0.1/test.jpg!100!100
//重新编译nginx加上 --with-http_image_filter_module
location ~* (.*\.(jpg|gif|png))!(.*)!(.*)$ {
set $w $3;
set $h $4;
rewrite (.*\.(jpg|gif|png))!(.*)!(.*)$ $1 break;
image_filter resize $w $h;
}
location ~ .*\.(gif|jpg|png)${
expires 30d;
}
以上就是nginx动态缩略图的内容,更多相关内容请关注PHP中文网(www.php1.cn)!