nginx.conf :
proxy_cache_path /tmp/cache levels=1:2 keys_zone=my_cache:100m max_size=10g inactive=60m use_temp_path=off;
www.xxx.com.conf:
server {
...
location / {
#proxy_cache_min_uses 3;
proxy_cache my_cache;
proxy_cache_key $host$uri$is_args$args;
proxy_cache_methods GET HEAD;
proxy_cache_valid 200 24h;
proxy_cache_valid any 10m;
add_header X-Cache-Status $upstream_cache_status;
proxy_pass http://localhost:8000;
}
}