Are numbered captures available to the proxy cache key construct?

portante nginx-forum at
Mon Sep 20 15:24:30 MSD 2010

Hi Folks,

Can somebody comment on whether proxy_cache_key is supposed to be able
to handle # captures? I believe the below example shows how I want to
use it, but I can't get it to work.



location    ~   ^/api/rest/\d+/(.+)/.+/*$ {
    proxy_cache             apiCache;
    proxy_cache_valid       200  7d;
    proxy_cache_use_stale   updating;
    proxy_cache_key         "$host.$1";
    if ($upstream_http_content_encoding !~* "") { gzip off; }
    proxy_pass    $request_uri;

Posted at Nginx Forum:,132186,132186#msg-132186

More information about the nginx mailing list