Welcome! Log In Create A New Profile

Advanced

Re: fastcgi_cache_key with cookie

December 27, 2011 02:46AM
I've also tried this using the userid module I set a custom cookie like so

userid on;
userid_name "testid";
userid_expires 100s;

and set the fastcgi_cache_key like so

fastcgi_cache_key $cookie_testid$request_method$scheme$host$request_uri

the problem with this setup is when I login or logout, since the key is based on only $cookie_testid without $http_cookie, then the user will still see the logged in page even after logging out. Alternatively how would I user the cache purge module to purge the key when the user hits the login or logout button? this is the sample config

http {
proxy_cache_path /tmp/cache keys_zone=tmpcache:10m;

server {
location / {
proxy_pass http://127.0.0.1:8000;
proxy_cache tmpcache;
proxy_cache_key $uri$is_args$args;
}

location ~ /purge(/.*) {
allow 127.0.0.1;
deny all;
proxy_cache_purge tmpcache $1$is_args$args;
}
}
}

not sure how to rewrite the url.
Subject Author Posted

fastcgi_cache_key with cookie

zenw December 27, 2011 12:13AM

Re: fastcgi_cache_key with cookie

António P. P. Almeida December 27, 2011 01:38AM

Re: fastcgi_cache_key with cookie

zenw December 27, 2011 01:53AM

Re: fastcgi_cache_key with cookie

zenw December 27, 2011 01:56AM

Re: fastcgi_cache_key with cookie

António P. P. Almeida December 27, 2011 02:36AM

Re: fastcgi_cache_key with cookie

zenw December 27, 2011 02:46AM

Re: fastcgi_cache_key with cookie

zenw December 27, 2011 02:48AM

Re: fastcgi_cache_key with cookie

António P. P. Almeida December 27, 2011 03:02AM

Re: fastcgi_cache_key with cookie

zenw December 27, 2011 03:24AM

Re: fastcgi_cache_key with cookie

António P. P. Almeida December 27, 2011 04:06AM

Re: fastcgi_cache_key with cookie

brianmercer December 27, 2011 12:01PM

Re: fastcgi_cache_key with cookie

António P. P. Almeida December 27, 2011 02:54PM

Re: fastcgi_cache_key with cookie

zenw December 27, 2011 08:15PM

Re: fastcgi_cache_key with cookie

zenw December 27, 2011 08:35PM

Re: fastcgi_cache_key with cookie

brianmercer December 27, 2011 11:15PM

Re: fastcgi_cache_key with cookie

zenw December 27, 2011 11:28PM

Re: fastcgi_cache_key with cookie

António P. P. Almeida December 28, 2011 02:04AM

Re: fastcgi_cache_key with cookie

brianmercer December 28, 2011 08:55AM

Re: fastcgi_cache_key with cookie

António P. P. Almeida December 28, 2011 11:54AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 275
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