Welcome! Log In Create A New Profile

Advanced

Issue with proxy_cache_key after rewrite

Sven 'Darkman' Michels
December 24, 2010 06:02PM
Hi,

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
httpmy_vhost/original_request_uri

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

Now we have the following request:
http//my_vhost/olddir/documents/test.pdf

so i thought the key should be
httpmy_vhost/documents/test.pdf

but it was
httpmy_vhost/olddir/documents/test.pdf

when i remove the proxy_cache_key from the config i get the following key:
http://interal_host:internal_port/documents/test.pdf

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...?

Regards,
Sven

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Issue with proxy_cache_key after rewrite

Sven 'Darkman' Michels December 24, 2010 06:02PM

Re: Issue with proxy_cache_key after rewrite

Piotr Sikora December 24, 2010 08:34PM

Re: Issue with proxy_cache_key after rewrite

Eugaia December 24, 2010 08:44PM

Re: Issue with proxy_cache_key after rewrite

Maxim Dounin December 24, 2010 10:52PM

Re: Issue with proxy_cache_key after rewrite

Sven 'Darkman' Michels December 25, 2010 08:46AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 182
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready