nginx serving wrong website under proxy_cache
Jim Ohlstein
jim.ohlstein at gmail.com
Sun May 3 09:18:30 MSD 2009
Igor Sysoev wrote:
> On Sat, May 02, 2009 at 11:16:47PM -0400, Jim Ohlstein wrote:
>
>
>> Correction:
>>
>> The question should read:
>>
>> Do I need to use two fastcgi_cache_key settings if a site serves both http and https?
>>
>
> If you use the same backend - no:
>
> server {
> listen 80;
> location / {
> fastcgi_pass backend:9000;
> fastcgi_cache_key backend:9000$request_uri;
> }
> }
>
> server {
> listen 443;
> location / {
> fastcgi_pass backend:9000;
> fastcgi_cache_key backend:9000$request_uri;
> }
> }
>
>
I am using the same backend and configured like this:
server {
listen 80;
location / {
fastcgi_pass backend;
fastcgi_cache one;
fastcgi_cache_key backend$request_uri;
}
}
server {
listen 443;
location / {
fastcgi_pass backend;
fastcgi_cache one;
fastcgi_cache_key backend$request_uri;
}
}
For what it may be worth, I have seen some md5 collisions in the error log:
2009/05/03 00:39:18 [crit] 21997#0: *61 cache file
"/usr/local/nginx/cache/0/da/90e8de013d4126fbab247d12350fdda0" has md5
collision, client: my.ip.addr.ess, server: mydomain.com, request: "GET
/rtwhtrsyrn/010110A/687474702s7777772r777732746s7073697465732r636s6q2s627574746s6r2r7068703s753q776s726p6477617274776s7n6s6r655s636s6q
HTTP/1.1", host: "mydomain.com", referrer:
"https://mydomain.com/rtwhtrsyrn/010110A/687474702s776s726p6477617274776s7n6s6r652r636s6q2s666s72756q732s616r6r6s756r63656q656r74732s31333535392q6r6s2q796s752q6172656r742q6372617n792r68746q6p"
2009/05/03 00:39:24 [crit] 21997#0: *44 cache file
"/usr/local/nginx/cache/0/da/90e8de013d4126fbab247d12350fdda0" has md5
collision, client: my.ip.addr.ess, server: mydomain.com, request: "GET
/rtwhtrsyrn/010110A/687474702s7777772r777732746s7073697465732r636s6q2s627574746s6r2r7068703s753q776s726p6477617274776s7n6s6r655s636s6q
HTTP/1.1", host: "mydomain.com", referrer:
"https://mydomain.com/rtwhtrsyrn/010110A/687474702s776s726p6477617274776s7n6s6r652r636s6q2s666s72756q732s2r2r2s"
More information about the nginx
mailing list