Not sure if it's passing to the proxy properly

Maxim Dounin mdounin at mdounin.ru
Fri Feb 5 12:30:12 MSK 2010


Hello!

On Fri, Feb 05, 2010 at 02:43:58AM -0500, James Matthews wrote:

> Hi,
> 
> I am passing my requests like this
>  if ( -f $request_filename){
>         expires 30d;
>         break;
> }
>         proxy_pass         http://127.0.0.1:20000;
> 
> However Apache is still serving everything (images included). How can I get
> it to move only through nginx (for images and other files).

Try this:

    location / {
        try_files $uri @fallback;
        expires 30d;
    }

    location @fallback {
        proxy_pass  http://127.0.0.1:20000;
    }

Maxim Dounin



More information about the nginx mailing list