lilingjie2015 发表于 2016-12-23 10:52:30

nginx 最简cache配置

  nginx.conf配置

#设置Web缓存区名称为cache_one,内存缓存空间大小为30MB,1天没有被访问的内容自动清除,硬盘缓存空间大小为30GB。
proxy_cache_path/data/cachelevels=1:2   keys_zone=cache_one:30m inactive=1d max_size=1g;

  location配置

proxy_cache cache_one;
#以域名、URI、参数组合成Web缓存的Key值,Nginx根据Key值哈希,存储缓存内容到二级缓存目录内
proxy_cache_key $host$uri$is_args$args;
proxy_cache_valid 5m;
页: [1]
查看完整版本: nginx 最简cache配置