当前位置 : 主页 > 网络编程 > PHP >

nginx动态缩略图

来源:互联网 收集:自由互联 发布时间:2021-06-30
//ubuntu 需要apt-get -y install libgd2-xpm-dev build-essential//127.0.0.1/test.jpg!100!100//--with-http_image_filter_module location ~* (.*\\.(jpg|gif|png))!(.*)!(.*)$ { set $w $3; set $h $4; image_filter resize $w $h; rewrite (.*\\.(jpg|
 
//ubuntu 需要apt-get -y install libgd2-xpm-dev build-essential
//127.0.0.1/test.jpg!100!100
//--with-http_image_filter_module
  
  
    location ~* (.*\\.(jpg|gif|png))!(.*)!(.*)$ {
        set $w     $3;
        set $h     $4;
        image_filter resize $w $h;
            rewrite (.*\\.(jpg|gif|png))!(.*)!(.*)$ $1 break;
        image_filter resize $w $h;
    }
  
        location ~ .*\\.(gif|jpg|png)${
                expires 30d;
        }

网友评论