Issue with proxy_cache_key after rewrite

Sven 'Darkman' Michels sven at
Sat Dec 25 01:57:30 MSK 2010


i've run a few tests with the nginx proxy module. I would like to have
my content cached with the "$scheme$host$request_uri" key, like suggested
on the wiki page[1]. So i've added the following:
proxy_cache_key "$scheme$host$request_uri";

into the http {} block. After the test i've checked the keys which are used
in the cached files and noticed that the key was

but i've a perl module which does a internal_redirect which rewrites some
paths like /olddir/ to /.

Now we have the following request:

so i thought the key should be

but it was

when i remove the proxy_cache_key from the config i get the following key:

so something here seems to be "strange". Because the default key is:
default: $scheme$proxy_host$request_uri;

and now we see the following differences:
first: $scheme seems to be http when beeing used, but http:// when default.
second: the $request_uri is not rewritten when defined as key, but it seems
to be rewritten by default.

Seems like a bug to me...?


More information about the nginx mailing list