nginx enables proxy cache proxy cache

nginx enables proxy cache proxy cache

in nginx.conf

http {

add below

proxy_cache_path /data/nginxcache levels=1:2 keys_zone=my_cache:500m max_size=10g inactive=30d use_temp_path=off;

Add the following configuration to the configuration file of a site:

location / {

proxy_cache my_cache;

proxy_cache_revalidate on;

#proxy_cache_valid 200 206 304 301 302 30d;

proxy_cache_valid any 30d;

proxy_ignore_headers “Set-Cookie”;

proxy_ignore_headers “Expires”;

#proxy_ignore_headers “Age”;

proxy_cache_key…

The post nginx enables proxy cache proxy cache first appeared on Lenix Blog .

This article is reprinted from https://blog.p2hp.com/archives/9267
This site is for inclusion only, and the copyright belongs to the original author.

Leave a Comment