I'm trying to cache the same page twice based on the content-type within the HTTP header.
We have a number of pages which can be requested as XML or JSON. As it stands NginX only caches the first request and serves all other request using the cached version whether XML or JSON is requested.
We have tried setting the proxy_cache_key to;
proxy_cache_key "$scheme$proxy_host$request_uri$upstream_http_content_type";
However I assume that $upstream_http_content_type is not a suitable variable here, nor did $http_accept work.
Can anyone recommend a work around?