#缓存配置 表示10天没有被访问的内容自动清除,硬盘最大缓存空间为2GB,超过这个大学将清除最近最少使用的数据。
proxy_cache_path /nginx/cache levels=1:2 keys_zone=cache_one:50m inactive=10d max_size=2g;
proxy_temp_path /nginx/cache/temp;
location /x5/ {
#缓存配置
proxy_cache cache_one;
proxy_cache_lock on;
proxy_cache_valid 200 304 12h;
#proxy_cache_valid any 10s;
proxy_cache_use_stale updating;
proxy_cache_key $host$uri$is_args$args;
proxy_pass http://127.0.0.1:8080;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect http:// https://;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
}