nignx的proxy_cache

http段配置:

#cache config
client_body_buffer_size 512k;
proxy_connect_timeout 5;
proxy_read_timeout 60;
proxy_buffer_size 16k;
proxy_buffers 4 64k;
proxy_busy_buffers_size 128k;
proxy_temp_file_write_size 128k;

# 以下两个配置指向路径必须在同一个分区
proxy_temp_path /home/temp;
proxy_cache_path /home/cache levels=1:2 keys_zone=content:20m inactive=1d max_size=100m;


server段配置

#proxy_cache config

proxy_cache content;
proxy_cache_valid 200 304 301 302 10d;
proxy_cache_valid 1d;
proxy_cache_key $host$uri$is_args$args;

# 忽略的header头配置
proxy_ignore_headers Cache-Control;

# 后端服务配置
proxy_pass http://utm;





posted @ 2013-10-14 08:34  rorshach  阅读(240)  评论(0编辑  收藏  举报