Forum: NGINX proxy_cache_key

Posted by jhauser (Guest)
on 2010-03-07 12:55
(Received via mailing list)
Hello, I want to generate the file path of proxy cached data from the
proxy_cache_key variable. Is there some pseudo-code to generate the
same hash as nginx does internally?

Or would it be possible to make the generated cache_key available as a
loggable variable?

With regards,

__Janko
Posted by schmoove (Guest)
on 2010-03-25 15:15
(Received via mailing list)
The documentation for the  proxy_cache_path directive of the 
NginxHttpProxyModule  states that the "Key and filename in cache is md5 
of proxied URL". Here is an example:

a user requests:
    http://nginx.foo.com/bar.html

nginx has the proxy_pass directive:
    proxy_pass  http://apache.foo.com/

the cached filename will be the md5 of:
    http://apache.foo.com/bar.html

This worked for me when using the default proxy_cache_key with nginx 
0.7.62

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?2,61057,67641#msg-67641
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.