HTTP upstream variables

$upstream_cache_status variable

Reports MISS, BYPASS, EXPIRED, STALE, UPDATING, REVALIDATED or HIT when cache access has a status. It may be unset for noncached routes.

Formal Syntax & Structure

nginx syntaxnginx
$upstream_cache_status

Working Example

Example Snippetnginx
add_header X-Lab-Cache $upstream_cache_status always;
Nginx Reference