# The meaning of two proxy\_pass directives

**URL:** <https://www.ruby-forum.com/t/the-meaning-of-two-proxy-pass-directives/208720>\
**Category:** NGINX\
**Created:** [June 25, 2011, 9:38am UTC](https://www.ruby-forum.com/t/the-meaning-of-two-proxy-pass-directives/208720 "2011-06-25T09:38:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [June 25, 2011, 9:38am UTC](https://www.ruby-forum.com/t/the-meaning-of-two-proxy-pass-directives/208720/1 "2011-06-25T09:38:00Z")

</div>

I saw some nginx configs written like this:

location ~ {  
…  
proxy\_pass [http://upstream1](http://upstream1);  
proxy\_pass [http://upstream2](http://upstream2);  
…  
}

What this config meaning? proxy\_pass to upstream2 if proxy\_pass to  
upstream fails?

Thanks.

Posted at Nginx Forum:

> **[The meaning of two proxy\_pass directives](https://forum.nginx.org/read.php?2,209883,209883#msg-209883)**
>
> I saw some nginx configs written like this: location ~ { ... proxy\_pass http://upstream1; proxy\_pass http://upstream2; ... } What this config meaning? proxy\_pass to upstream2 if proxy\_pass to upstream fails? Thanks.

---

<div class="post-metadata">

**Author:** ![speedfirst](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e19adc/32.png) [@speedfirst](https://www.ruby-forum.com/u/speedfirst)\
**Post date:** [June 25, 2011, 9:38am UTC](https://www.ruby-forum.com/t/the-meaning-of-two-proxy-pass-directives/208720/2 "2011-06-25T09:38:37Z")

</div>

sorry. typo.  
proxy\_pass to upstream2 if proxy\_pass to upstream1 fails?

Posted at Nginx Forum:

> **[Re: The meaning of two proxy\_pass directives](https://forum.nginx.org/read.php?2,209883,209884#msg-209884)**
>
> I saw some nginx configs written like this: location ~ { ... proxy\_pass http://upstream1; proxy\_pass http://upstream2; ... } What this config meaning? proxy\_pass to upstream2 if proxy\_pass to upstream fails? Thanks.

---

<div class="post-metadata">

**Author:** ![speedfirst](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e19adc/32.png) [@speedfirst](https://www.ruby-forum.com/u/speedfirst)\
**Post date:** [June 25, 2011, 9:41am UTC](https://www.ruby-forum.com/t/the-meaning-of-two-proxy-pass-directives/208720/3 "2011-06-25T09:41:42Z")

</div>

On Sat, Jun 25, 2011 at 03:37:17AM -0400, speedfirst wrote:

> upstream fails?  
> This is a wrong configuration, as well as

```
 location ... {
      proxy_pass ...
      fastcgi_pass ...
 }

```

nginx currently does not report this is as error.

–  
Igor S.

---

<div class="post-metadata">

**Author:** ![speedfirst](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e19adc/32.png) [@speedfirst](https://www.ruby-forum.com/u/speedfirst)\
**Post date:** [June 26, 2011, 3:55am UTC](https://www.ruby-forum.com/t/the-meaning-of-two-proxy-pass-directives/208720/4 "2011-06-26T03:55:14Z")

</div>

so what will happen if config like this? Only the 2nd proxy\_pass takes  
effect?

Posted at Nginx Forum:

> **[Re: The meaning of two proxy\_pass directives](https://forum.nginx.org/read.php?2,209883,210090#msg-210090)**
>
> I saw some nginx configs written like this: location ~ { ... proxy\_pass http://upstream1; proxy\_pass http://upstream2; ... } What this config meaning? proxy\_pass to upstream2 if proxy\_pass to upstream fails? Thanks.
