Welcome! Log In Create A New Profile

Advanced

Re: proxy_cache_key + redirects

Mirosław Jaworski
March 03, 2010 02:30PM
On Wed, 2010-03-03 at 19:49 +0100, Taras Girnyk wrote:
> Of course, with such setup when i load a.com and after 5 min load b.com
> i see cached result from a.com. But with this login page i can't even
> imagine why this to different urls is caching as the same one.

Unfortunately nginx site lacks sane examples.

If you happen to have Host: header based virtual servers on the same
backend and you don't use separate nginx server {} sections for those
virtuals on the frontend, you want to use $host variable within
proxy_cache_key.

I use
proxy_cache_key $scheme://$host$request_uri;

> Also, if i add $host in proxy_cache_key i'm starting to get permanent
> redirects.

This may be the side effect of the application on the backend,
which behaves this way when it cannot set cookies ( doesn't receive
it after trying to set it ). Use
proxy_pass_header Set-Cookie;
within your proxying location / {}

--
Miroslaw "Psyborg" Jaworski
GCS/IT d- s+:+ a C++$ UBI++++$ P+++$ L- E--- W++(+++)$ N++ o+ K- w-- O-
M- V- PS+ PE++ Y+ PGP t 5? X+ R++ !tv b++(+++) DI++ D+ G e* h++ r+++ y?


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

proxy_cache_key + redirects

Taras Girnyk March 03, 2010 01:54PM

Re: proxy_cache_key + redirects

Mirosław Jaworski March 03, 2010 02:30PM

Re: proxy_cache_key + redirects

Taras Girnyk March 03, 2010 03:08PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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