yum安裝nginx 加載image_filter 加載方式
阿新 • • 發佈:2017-05-30
jpg set load def class nbsp default logs con
通過yum安裝的nginx 加載image_filter方式方法:
yum install -y gd-devel libgd gcc libgd
yum install -y nginx-module-image-filter
在 nginx.conf 中最上方寫入
load_module modules/ngx_http_image_filter_module.so;
在conf.d/default.conf 寫入
location ~* /image/(.*)_(\d+)j(\d+)\.jpg$ {
root /;
set $s $1;
set $w $2;
set $h $3;
image_filter resize $w $h;
image_filter_buffer 10M;
rewrite ^/image/(.*)$ /mypath/$s.jpg break;
}
yum安裝nginx 加載image_filter 加載方式