禁用某些文件类型的nginx缓存

Tho*_*mas 6 caching nginx

我有nginx设置,充当apache的反向代理.但是,我需要禁用GIF的缓存.我怎么能在nginx上做到这一点?

谢谢

Art*_*kii 5

这应该做的伎俩:

set $no_cache "";
if ($request_uri ~* \.gif$) {
  set $no_cache "1";
}
proxy_no_cache $no_cache;
proxy_cache_bypass $no_cache;
Run Code Online (Sandbox Code Playgroud)