Welcome! Log In Create A New Profile

Advanced

Re: session cache

Дмитрий Лабазнов
December 03, 2013 01:58AM
On Mon, Dec 02, 2013 at 09:29:53PM +0400, Дмитрий Лабазнов wrote:

> Hi there,

> > If it is a cookie called "user", then something like
>
> > proxy_cache_key "$host$request_uri $cookie_user";

> yes cookie, what does it mean called "user" ?
> Users have a cookie session, and this strind do not work =(

> http://nginx.org/en/docs/http/ngx_http_core_module.html#variables

> or maybe

> http://nginx.org/ru/docs/http/ngx_http_core_module.html#variables

> If the cookie name is "session", then the nginx variable is
> $cookie_session.

THX!!!! Its work!
location ~* ^/.+\.(php)$ {
proxy_cache_methods GET HEAD POST;
proxy_ignore_headers Cache-Control Expires;
proxy_cache_key "$host$request_uri $cookie_PHPSESSID";
proxy_pass http://localhost:8080;
proxy_temp_path /tmp/nginx/tmp;
proxy_cache one;
proxy_cache_valid 200 304 1m;
expires 1m;
}
here i cache all php dynavics, cous it is from test stand. But it is work,
dynamic for various browsers cached
in conformity with they cookies. Thx a lot!
It is strange, this easy example i couldnt google for my case and situation..




2013/12/2 Francis Daly <francis@daoine.org>

> On Mon, Dec 02, 2013 at 09:29:53PM +0400, Дмитрий Лабазнов wrote:
>
> Hi there,
>
> > > If it is a cookie called "user", then something like
> >
> > > proxy_cache_key "$host$request_uri $cookie_user";
>
> > yes cookie, what does it mean called "user" ?
> > Users have a cookie session, and this strind do not work =(
>
> http://nginx.org/en/docs/http/ngx_http_core_module.html#variables
>
> or maybe
>
> http://nginx.org/ru/docs/http/ngx_http_core_module.html#variables
>
> If the cookie name is "session", then the nginx variable is
> $cookie_session.
>
> f
> --
> Francis Daly francis@daoine.org
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

session cache

Дмитрий Лабазнов December 02, 2013 07:48AM

Re: session cache

Francis Daly December 02, 2013 12:18PM

Re: session cache

Дмитрий Лабазнов December 02, 2013 12:20PM

Re: session cache

Francis Daly December 02, 2013 12:22PM

Re: session cache

Дмитрий Лабазнов December 02, 2013 12:32PM

Re: session cache

Francis Daly December 02, 2013 12:42PM

Re: session cache

Дмитрий Лабазнов December 03, 2013 01:58AM

Re[2]: session cache

artem December 02, 2013 01:56PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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