Unable to cache long cache url
samgujrat1984
nginx-forum at nginx.us
Thu May 15 16:23:06 UTC 2014
Hello Every One,
I am trying to cache a long string query url with proxy_cache_key. I am not
sure where I am doing wrong. I tried different proxy_cache_key patterns. Not
sure where I am doing wrong. If some one can suggest me please
http://x.x.x.x/uri/splash?TF=100%25&US=A&AR=D&TD=%2450&BR=T&TS=12515f542140&OR=%2410%2F100MB&DN=BAQGBgEEBwQAAw%3D%3D&ET=TD&BE=1332d9a&BN=CS&AL=2000
____________ Configs _____________
location /keystone/splash {
proxy_pass http://x.x.x.x:8080/keystone/splash;
set $no_cache "";
if ($request_method !~ ^(GET|HEAD)$) {
set $no_cache "1";
}
if ($no_cache = "1") {
add_header Set-Cookie "_mcnc=1; Max-Age=2; Path=/";
add_header X-Microcachable "0";
}
if ($http_cookie ~* "_mcnc") {
set $no_cache "1";
}
proxy_no_cache $no_cache;
proxy_cache_bypass $no_cache;
proxy_cache webapp;
#proxy_cache_key $scheme$host$request_method$request_uri;
#proxy_cache_key
"$host$uri?TF=100%25&US=A&AR=D&TD=%2450&BR=T&TS=12515f542140&OR=%2410%2F100MB&DN=BAQGBgEEBwQAAw%3D%3D&ET=TD&BE=1332d9a&BN=CS&AL=2000&LG=E";
#proxy_cache_key
"$host$uri?TF=100%25&US=A&AR=D&TD=%2450&BR=T&TS=12515f542140&OR=%2410%2F100MB&DN=BAQGBgEEBwQAAw%3D%3D&ET=TD&BE=1332d9a&BN=CS&AL=2000";
#proxy_cache_key "$scheme://$host$uri$is_args";
proxy_cache_key $uri$is_args?TF=$arg_TF &US=$arg_US
&AR=$arg_AR
&TD=$arg_TD&BR=$arg_BR&TS=$arg_TS&OR=$arg_OR&DN=$arg_DN&ET=$arg_ET&BE=$arg_BE&BN=$arg_BN&AL=$arg_AL;
proxy_cache_valid 200 302 60s;
proxy_cache_valid 301 60s;
proxy_cache_valid any 60s;
proxy_cache_use_stale updating;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_max_temp_file_size 1M;
}
}
Posted at Nginx Forum: http://forum.nginx.org/read.php?2,250126,250126#msg-250126
More information about the nginx
mailing list