Welcome! Log In Create A New Profile

Advanced

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

March 25, 2011 06:16AM
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
Subject Author Posted

Не кешировать определенную страницу

Александр Рочев March 24, 2011 06:42PM

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

Илья Винокуров March 24, 2011 06:46PM

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

Igor Sysoev March 25, 2011 06:16AM

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

Александр Рочев March 25, 2011 05:18PM

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

Александр Рочев March 25, 2011 05:28PM

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

Алферов Василий March 26, 2011 07:56AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 131
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready