nginx - 缓存 NGINX 代理返回 MISS
问题描述
我目前有以下配置:
proxy_cache_path /tmp/nginx levels=1:2 keys_zone=my_zone:180m inactive=60m max_size=700m;
proxy_cache_valid 200 302 10m;
proxy_cache_valid 404 1m;
proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
...
server_name example.com
location / {
proxy_cache my_zone;
proxy_cache_key "$scheme://$host$uri";
proxy_cache_valid 200 301 302 100d;
proxy_cache_bypass $http_cache_control;
proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
add_header X-Proxy-Cache $upstream_cache_status;
include proxy_params;
proxy_pass http://127.0.0.1:8000;
}
但是在访问服务器时,我似乎总是得到x-proxy-cache: MISS
:
$ curl -I https://example.com
怎么来的?
解决方案
推荐阅读
- doctrine-orm - Symfony 4:防止 Doctrine Fixtures 被加载到 DEV 环境中
- mysql - 在 Django 中使用条件注释时出错:select_format
- r - 使用 age_calc() 将出生日期转换为年龄(包 eeptools)
- python - 更改键盘快捷键以注释掉 Spyder 中的行
- python - python opencv清除噪音并删除框
- docker - Docker 构建失败,当前 .NET SDK 不支持面向 .NET Core 2.1
- php - 如何通过电子邮件发送 PHP 中的整个请求
- javascript - 在刮板完成之前如何锁定 websocket(或状态)连接
- wordpress - wordpress 循环和多个谷歌地图在控制台中出现错误
- python - Flask中验证失败时如何覆盖html默认“请填写此字段”?