💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
[TOC] ## 概述 编译时,需要带上` —with-http_image_filter_module` ``` ./configure --prefix=/usr/local/nginx-1.19.1 --with-http_stub_status_module --with-http_realip_module --with-http_image_filter_module --with-debug ``` ``` location ~* /(\d+)\.(jpg)$ { set $h $arg_h; # 获取参数h的值 set $w $arg_w; # 获取参数 w 的值 #image_filter crop $h $w; image_filter resize $h $w;# 根据给定的长宽生成缩略图 } location ~* /(\d+)_(\d+)x(\d+)\.(jpg)$ { if ( -e $document_root/$1.$4 ) { # 判断原图是否存在 rewrite /(\d+)_(\d+)x(\d+)\.(jpg)$ /$1.$4?h=$2&w=$3 last; } return 404; } ``` 部署好后测试 `http://xxxx:12345/images/2021-01/202101250944272_500x400.png`