nginx的配置
[ol]proxy_cache_path /data/wwwroot/caches/www.abc.com levels=1:2 keys_zone=Rats:50m inactive=30m max_size=50m;
server {
listen 80;
server_name www.abc.com;
charset utf-8,gbk;
location / {
proxy_set_header Accept-Encoding "";
proxy_pass https://www.abc.com;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_cache Rats;
proxy_cache_valid 200 304 30m;
proxy_cache_valid 301 24h;
proxy_cache_valid 500 502 503 504 0s;
proxy_cache_valid any 1s;
proxy_cache_min_uses 1;
expires 12h;
}
}[/ol]复制代码
在Chrome F12 调试发现是首页也被缓存了,在登录后返回首页,是304状态让客户端使用本地缓存,导致没登录
有没有大神知道如何解决。