yum安装nginx 加载image_filter 加载方式

高豪
2023-12-01

通过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;
}

 

转载于:https://www.cnblogs.com/mangoVic/p/6920844.html

 类似资料: