今天切换环境,发现上传至fastdfs的图片无法找到,出现响应400
检查路径发现新环境fastdfs回传的url出现多余的 /group1 路径,应该是配置了url回传 group
1、打开 fastdfs-tracker , 修改nginx 配置,重写url方式解决,过滤多余的 /group1
location ~* /M00 {
index index.html index.htm;
rewrite "/([0-9a-zA-Z]{6})/([0-9a-zA-Z]{3})/([0-9a-zA-Z]{2})/([0-9a-zA-Z]{2})/([0-9a-zA-Z]*).(jpg|png)" /$2/$3/$4/$5.$6 last;
proxy_pass http://fdfs_group1;
}
location ~* /M00 {
index index.html index.htm;
rewrite "/([0-9a-zA-Z]{6})/([0-9a-zA-Z]{3})/([0-9a-zA-Z]{2})/([0-9a-zA-Z]{2})/([0-9a-zA-Z]*).(jpg|png)" /$2/$3/$4/$5.$6 last;
proxy_pass http://fdfs_group1;
}