nginx 最简cache配置

nginx.conf配置

	#设置Web缓存区名称为cache_one,内存缓存空间大小为30MB,1天没有被访问的内容自动清除,硬盘缓存空间大小为30GB。
	proxy_cache_path  /data/cache  levels=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;

猜你喜欢

转载自badqiu.iteye.com/blog/1772666
今日推荐