#图片自动缩略图
server {
listen 803;
server_name localhost ;
access_log off ;
client_max_body_size 100M;
location / {
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Headers X-Requested-With;
add_header Access-Control-Allow-Methods GET,POST,OPTIONS;
#proxy_set_header Host "m.isoftstone-gz.com";
#proxy_pass http://210.22.27.210:8139;
root /data/apps/static;
index index.html index.htm;
}
location ~* /image_data/(.*)_(\d+)x(\d+)\.(jpg|gif|png)$ {
root /data/apps/static;
set $s $1;
set $w $2;
set $h $3;
set $type $4;
#default_type image/jpeg;
image_filter resize $w $h;
#image_filter crop $w $h;
image_filter_buffer 10M;
image_filter_jpeg_quality 85;
image_filter_interlace on; # 将jpeg图片转换为可以渐进式加载的格式,这样用户可以尽快看到图片效果
image_filter_transparency on; # 是否保留图片的透明像素,因为我们还有png图,所以这里要打开
rewrite ^/image_data/(.*)$ /image_data/$s.$type break;
try_files /image_data/$s.$type /image_data/notfound.jpg;
}
}