nginx配置反向代理proxy_cache缓存
作者:
码农私房菜 | 来源:发表于
2022-09-17 16:08 被阅读0次http {
...
upstream httpget {
server 192.168.44.104:8080;
}
proxy_cache_path /ngx_tmp levels= 1:2 keys_zone=test_cache:100m inactive=1d max_size=10g; # 临时文件存一天
server {
listen80;
server_name localhost;
location / {
proxy_pass http://httpget;
add_header Nginx-Cache "$upstream_cache_status";
proxy_cache test cache;
proxy_cache_valid 1h; # 请求资源过期时间
root html;
}
}
本文标题:nginx配置反向代理proxy_cache缓存
本文链接:https://www.haomeiwen.com/subject/ttgyortx.html
网友评论