http下配置:
proxy_cache_path /var/cache/nginx/static_temp levels=1:2 keys_zone=imgcache:100m inactive=1d max_size=10g;
server下:
location ~ .*\.(js|css|htm|html|gif|jpg|jpeg|png|bmp|swf|ioc|rar|zip|txt|flv|mid|doc|ppt|pdf|xls|mp3|wma)$
log_not_found off;
expires 30d;
proxy_pass http://192.168.1.148;
proxy_cache imgcache;
proxy_cache_valid 200 302 1d;
proxy_cache_valid 404 10m;
proxy_cache_valid any 1h;
proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
#access_log off;
}