# Proxy pass if not found on local

**URL:** <https://www.ruby-forum.com/t/proxy-pass-if-not-found-on-local/193911>\
**Category:** NGINX\
**Created:** [August 26, 2010, 1:58pm UTC](https://www.ruby-forum.com/t/proxy-pass-if-not-found-on-local/193911 "2010-08-26T13:58:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![stingreen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a3d4f5/32.png) [@stingreen](https://www.ruby-forum.com/u/stingreen)\
**Post date:** [August 26, 2010, 1:58pm UTC](https://www.ruby-forum.com/t/proxy-pass-if-not-found-on-local/193911/1 "2010-08-26T13:58:05Z")

</div>

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](http://somedomain.com).  
Thanks in advance,

```
   location / {

        index index.html index.htm;
        root /foo/bar/htdocs;
        proxy_pass http://somedomain.com/;

```

}

Posted at Nginx Forum:

> **[proxy pass if not found on local](https://forum.nginx.org/read.php?2,123879,123879#msg-123879)**
>
> 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 inde

---

<div class="post-metadata">

**Author:** ![stingreen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/a3d4f5/32.png) [@stingreen](https://www.ruby-forum.com/u/stingreen)\
**Post date:** [August 26, 2010, 3:04pm UTC](https://www.ruby-forum.com/t/proxy-pass-if-not-found-on-local/193911/2 "2010-08-26T15:04:50Z")

</div>

Hello!

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

> ```
> 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 D.
