安装thumbor
docker run -p 8888:80 minimalcompact/thumbor
nginx配置
minio: http://111.229.27.144
thumbor: http://10.0.16.2
location ~* /(.+)\.(jpg|gif|png|jpeg|webp|bmp) {
#声明完整的请求地址
set $foo $scheme://$host/$1.$2;
set $thumbor 1;
add_header XCDN-Cut 'success';
#忽略源站header,强制缓存
proxy_ignore_headers X-Accel-Expires Expires Cache-Control Set-Cookie Vary;
proxy_connect_timeout 5;
# Default is HTTP/1, keepalive is only enabled in HTTP/1.1
proxy_http_version 1.1;
proxy_set_header Connection "";
#chunked_transfer_encoding off;
if ($arg_w = "") {
set $thumbor 0;
}
if ($arg_h = "") {
set $thumbor 0;
}
if ($thumbor = 1) {
# 参数 w 和 h 同时存在,选择反向代理 URL1
proxy_pass http://10.0