proxy pass if not found on local

Maxim Dounin mdounin at mdounin.ru
Thu Aug 26 17:04:04 MSD 2010


Hello!

On Thu, Aug 26, 2010 at 07:57:05AM -0400, stingreen wrote:

> Hello,
> Well, the subject says it all. Is it possible ? I tried something like
> the following without success. Check the htdocs first, if not found,
> look under somedomain.com. 
> Thanks in advance,
> 
> 
>        location / {
> 
>             index  index.html index.htm;
>             root /foo/bar/htdocs;
>             proxy_pass http://somedomain.com/;
>  }

    location / {
        index ...
        root ...
        try_files $uri $uri/ @fallback;
    }

    location @fallback {
        proxy_pass http://somedomain.com;
    }

Maxim Dounin



More information about the nginx mailing list