My configuration looks like this:
proxy_cache_path /cache/ssd keys_zone=ssd_cache:10m levels=1:2 inactive=600s max_size=100m;
proxy_cache_path /cache/hdd keys_zone=hdd_cache:10m levels=1:2 inactive=600s max_size=100m;
upstream backend {
server www.test.com:443;
}
server {
listen 80;
server_name test.com;
location / {
proxy_pass https://backend;
proxy_redirect https://backend/ /;
proxy_set_header Host $host;
proxy_cache $cache;
}
}
map $upstream_http_content_length $cache {
volatile;
~^\d\d\b ssd_cache;
default hdd_cache;
}