I’ve installed nginx as proxy-caching server and now got such a problem.
One of backend is hosting magento websites, while trying to log in into
admin panel (url looks like http://…/admin) system want to send client
to url http://…/index.php/admin/dashboard but for some reason it is
already cached and i’m getting the previous page. For this setup i’m
using such configuration:
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.
Also, if i add $host in proxy_cache_key i’m starting to get permanent
redirects.
When i’m trying to load www.a.com backend reports 302 Location: http://www.a.com and this loop continious forever.
What i’m doing wrong and what proxy_cache_key i should use to get this
working properly?
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 / {}
I use
proxy_cache_key $scheme://$host$request_uri;
Yes, i done this to be able at least to test something.
proxy_pass_header Set-Cookie;
within your proxying location / {}
Thank you for your reply, i just find this solution half an hour ago, i
was trying to do this with all Cookie-commands possible which i found
over the web, finally came to this solution and all is working fine now.
Anyway, thanks.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.