#Define the proxy cache path, cache file storage path, cache initial size and maximum cache time
proxy_cache_path d:codecache levels=1:2 keys_z max_size=20m inactive=1m;
location / {
#Configure the above The value of the defined keys_zone
proxy_cache cache1;
#Do not query the cache when configuring which parameters are included in the url
proxy_cache_bypass $arg_name;
#Define the cache key
proxy_cache_key $host$uri$is_args$args;
#Cache time, if there is Cache-Control in the header information in the response, the cache time in the header shall prevail
proxy_cache_valid 2m;
#When there is an error in returning to the source after the cache expires, the old data in the cache can be used. The old data is always smaller than the cache time. Error strong
proxy_cache_use_stale error timeout http_502 http_404;
proxy_pass http://127.0.0.1:8080;
}
The above introduces the nginx proxy_cache configuration instructions, including proxy and nginx content. I hope it will be helpful to friends who are interested in PHP tutorials.