Welcome! Log In Create A New Profile

Advanced

Re: Questions about solutions when using proxy_cache to redirect to cached pages for non logged in users.

Zev Blut
February 16, 2010 05:22AM
Hello!

Thanks for the comments.
Let me look into the Cookie and Vary answers in a later mail.

Below, is my reply about the proxy_pass question.

On 02/16/2010 06:59 PM, Maxim Dounin wrote:
> Hello!
>
> On Tue, Feb 16, 2010 at 05:25:43PM +0900, Zev Blut wrote:
>
>> Hello,
>>
>> I am trying out the proxy_cache commands in nginx. The recent mails
>> on the mailing list have been quite helpful for figuring out what to
>> do. I am able to use nginx to cache pages for non logged in users and
>> have logged in users go directly to the backend.
>>
>> I have a few questions about if I am calling proxy_pass correctly, and
>> if I can use proxy_pass_header to only let a certain Set-Cookie header
>> through.
>>
>> * in location / I rewrite to either the logged in or not logged in states.
>> But, I have to explicitly regex catch the real uri and add the args
>> to the proxy pass.
>> i.e.
>>
>> http://example.com/search?keword=nginx
>>
>> would lose the ?keyword=nginx if I just used
>> proxy_pass http://app/$1
>>
>> Is my solution for calling "proxy_pass http://app/$1?$args;" correct?
>
> This should work, but it's just waste of cpu. Use
>
> location /not_logged_in_user/ {
> proxy_pass http://app/;
> ...
> }
>
> instead.


Yes, I tried this, but then app behind the proxy_pass gets a request like:

/not_logged_in_user/search?keyword=nginx

Which it fails on, because it does not recognize /not_logged_in_user/ or
/logged_in_user/ as part of its' path. Of course I could change the
backend app to recognize these paths, but that would be more wasted cpu
than having nginx do it.

Or am I missing something?

Thanks,
Zev

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

Questions about solutions when using proxy_cache to redirect to cached pages for non logged in users.

Zev Blut February 16, 2010 03:32AM

Re: Questions about solutions when using proxy_cache to redirect to cached pages for non logged in users.

Maxim Dounin February 16, 2010 05:08AM

Re: Questions about solutions when using proxy_cache to redirect to cached pages for non logged in users.

Zev Blut February 16, 2010 05:22AM

Re: Questions about solutions when using proxy_cache to redirect to cached pages for non logged in users.

Maxim Dounin February 16, 2010 05:28AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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