Issue with proxy_cache_key after rewrite

Eugaia ngx.eugaia at gmail.com
Sat Dec 25 04:41:18 MSK 2010


Hi,

On 25/12/2010 03:29, Piotr Sikora wrote:
>> So i've added the following:
>> proxy_cache_key "$scheme$host$request_uri";
>
> Try using "$scheme$host$uri$is_args$args" ;)
Probably putting '://' or something else that won't be the first 
character of a URL (e.g. '#') between $scheme and $host is a good idea, 
just in case you have two hosts that only differ by an initial 's' -

e.g. mysite.com and smysite.com

https + mysite.com = http + smysite.com

In most situations this will be fine, but depending on the setup, it 
could potentially be a source of bugs or a security hole.

Marcus.



More information about the nginx mailing list