Re: Re[2]: Не кешировать определенную страницу

Алферов Василий vasilii.alferov на gmail.com
Сб Мар 26 14:55:30 MSK 2011


http://sysoev.ru/nginx/docs/http/ngx_http_proxy_module.html#proxy_cache_bypass

сделайте еще один map и укажите оба в  proxy_cache_bypass и proxy_nocache

2011/3/26 Александр Рочев <foxr на mail.ru>

> Сапсибо Игорь, помогло.
> А если у меня есть еще переменная, которую я не хочу кешировать
> $arg_order_custinfo - как сделать чтобы он обе учитывал? Два map нельзя,
> учитывает последний.
>
>
> Fri, 25 Mar 2011 13:15:17 +0300 письмо от Igor Sysoev <igor на sysoev.ru>:
>
> > On Fri, Mar 25, 2011 at 01:41:54AM +0300, Александр Рочев wrote:
> > > Доброй ночи всем.
> > > Включил кеширование с помощью nginx.
> > >
> > > Мне необходимо не кешировать админку и корзину.
> > >
> > > Написал:
> > > location ~ (admin.php|index.php?shopping_cart=yes) {
> > > proxy_pass   (http://127.0.0.1:2002;)   (http://127.0.0.1:2002;)
> > http://127.0.0.1:2002; (http://127.0.0.1:2002;)
> > > proxy_redirect off;
> > > proxy_set_header Host $http_host;
> > > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
> > > proxy_set_header X-Real-IP $remote_addr;
> > > }
> > >
> > > Админка не кешируется, а корзина попадает в кеш. Подскажите как сделать
> так,
> > чтобы страница index.php?shopping_cart=yes не кешировалась?
> > > Спасибо.
> >
> > map $arg_shopping_cart  $nocache {
> > default             "";
> > yes                 11;
> > }
> >
> > server {
> >
> > proxy_redirect off;
> > proxy_set_header Host $http_host;
> > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
> > proxy_set_header X-Real-IP $remote_addr;
> >
> > location / {
> > proxy_pass   http://127.0.0.1:2002;
> > proxy_cache  ...
> > }
> >
> > location = /admin.php {
> > proxy_pass   http://127.0.0.1:2002;
> > }
> >
> > location = /index.php {
> > proxy_pass   http://127.0.0.1:2002;
> > proxy_cache  ...
> > proxy_cache_bypass   $nocache;
> > proxy_nocache        $nocache;
> > }
> >
> >
> > --
> > Игорь Сысоев
> > http://sysoev.ru
> >
> > _______________________________________________
> > nginx-ru mailing list
> > nginx-ru на nginx.org
> > http://nginx.org/mailman/listinfo/nginx-ru
> _______________________________________________
> nginx-ru mailing list
> nginx-ru на nginx.org
> http://nginx.org/mailman/listinfo/nginx-ru
>
----------- следущая часть -----------
Вложение в формате HTML было извлечено&hellip;
URL: <http://nginx.org/pipermail/nginx-ru/attachments/20110326/12375cef/attachment.html>


Подробная информация о списке рассылки nginx-ru