session cache

Дмитрий Лабазнов mail at labaznov.com
Tue Dec 3 06:57:17 UTC 2013


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 at 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 at daoine.org
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20131203/4f814d94/attachment.html>


More information about the nginx mailing list