I want to add header. Only If upstream cache is HIT
I use this in location block but not success:
if ($upstream_cache_status = "HIT") {
expires 1m;
add_header "X-Test-Header" "testvalue";
}
Using add_trailer also not succees. What is the solution?