Nginx has a variable $upstream_cache_status. This can be used for any upstream. We are using it mainly for our WordPress + fastcgi_cache. Define a new log_format in nginx.conf: log_format rt_cache '$remote_addr - $upstream_cache_status [$time_local] ' '"$request" $status $body_bytes_sent ' '"$http_referer" "$http_user_agent"'; Then in server block: Either replace lines like: access_log /var/log/ng
![Using $upstream_cache_status in access.log](https://cdn-ak-scissors.b.st-hatena.com/image/square/4f59a103a2d79321e1928a0f61d16b0ebbd36f9b/height=288;version=1;width=512/https%3A%2F%2Frtcamp.com%2Fwp-content%2Fuploads%2Fsites%2F2%2F2020%2F10%2FFB%402x.jpg%3Ffit%3D1640%252C624%26quality%3D100%26strip%3Dall)