Hello! On Sun, Mar 2, 2014 at 11:45 PM, 朱瑞卿 wrote: > nginx proxy_cache 缓存图片的时候,无.png 这种后缀名的如何缓存,直接浏览后台服务器图片 > 没有后缀名,比如百度:http://online3.map.bdimg.com/tile/?qt=tile&x=795&y=293&z=12&styles=pl&udt=20140226 > > 图片为.png 但url里面没有后缀名,这个nginx怎么去缓存 > 我没看出来为什么 nginx 的 http cache 不能缓存这种不带 .png 后缀的资源。我也没看出来 nginx 的 http cache 在处理 .png 后缀时有什么特别的地方。 Regards, -agentzh
location /mapabc/ { #error_log /usr/local/openresty/nginx/logs/error_map.log debug; proxy_pass http://mapabc; proxy_cache web_cache_map; proxy_cache_valid 404 1h; proxy_cache_valid any 10m; proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504; proxy_cache_key $host$uri$is_args$args; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header Nginx-Cache "$upstream_cache_status"; }