配置如下
proxy_temp_path /cache/proxy_temp_dir;
proxy_cache_path /cache/proxy_cache_dir levels=1:2 keys_zone=cache_one:3000m inactive=10d max_size=2999g;
upstream new_server {
server 192.168.8.182:80 weight=1 max_fails=2 fail_timeout=300s;
}
location ~ .*\.mp4$ {
expires 45d;
mp4;
add_header X-Cache HIT;
proxy_next_upstream http_502 http_504 error timeout invalid_header;
proxy_cache cache_one;
proxy_cache_valid 200 304 365d;
proxy_cache_key $request_uri;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://new_server;
}
发现只能按照 url 来缓存 1.mp4 和 1.mp4?start=199 1.mp4?start=100 1.mp4?start=120 这样带参数的的 会重复缓存
视频 都加了 关键帧
有什么办法可以 缓存 带了start 参数 关键帧的视频