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

Maxim Dounin mdounin at mdounin.ru
Tue Feb 16 13:25:10 MSK 2010


Hello!

On Tue, Feb 16, 2010 at 07:18:56PM +0900, Zev Blut wrote:

[...]

> >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

Looks like you tried

    proxy_pass http://app;

instead.  You should use 

    proxy_pass http://app/;

as I specified, note the trailing "/".

Once uri component is present in proxy_pass ("/" in this case) - 
it replaces part of uri matched by location.

Maxim Dounin



More information about the nginx mailing list