Home > php教程 > PHP源码 > body text

nginx动态缩略图

PHP中文网
Release: 2016-05-23 08:39:32
Original
1504 people have browsed it

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;
    }
Copy after login

                   

 以上就是nginx动态缩略图的内容,更多相关内容请关注PHP中文网(www.php.cn)!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!