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

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-01
  • 2022-01-26
  • 2021-05-30
  • 2021-11-25
  • 2021-05-24
相关资源
相似解决方案