# Not all locations considered

**URL:** <https://www.ruby-forum.com/t/not-all-locations-considered/221635>\
**Category:** NGINX\
**Created:** [July 23, 2012, 5:14pm UTC](https://www.ruby-forum.com/t/not-all-locations-considered/221635 "2012-07-23T17:14:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [July 23, 2012, 5:14pm UTC](https://www.ruby-forum.com/t/not-all-locations-considered/221635/1 "2012-07-23T17:14:36Z")

</div>

Hi All,

For a web application we have developed we wanted to use nginx as a  
reverse proxy but I have some trouble/weird issues when setting it up.  
Itseemds that part of my configuration is ignored, it appears it has to  
do with the order and amount of locations (but that is at first sight).  
We use nginx in a windows environment (on our test servers).

So what we wanted to is for a couple of applications create a single  
entry point (main-server on port 81) now when a request comes in for  
(/app1, /app2, /app3, /app4 it should pass it on to  
main-servier:9090/appX) For /app5 and /app6 it should forward to server1  
or server2 .

Our configuration is as follows (tried with and without ^~ but the same  
result).

–  
worker\_processes 1;

error\_log logs/error.log debug;

events {  
worker\_connections 1024;  
}

http {  
include mime.types;  
default\_type application/octet-stream;

```
sendfile on;
keepalive_timeout 65;

gzip on;

server {
    listen main-server:81;

```

location ^~ /app5 {  
include proxy.conf;  
proxy\_pass [http://server2:9080/sub-path/app5](http://server2:9080/sub-path/app5);  
}

location ^~ /app1 {  
include D:/nginx/conf/proxy.conf;  
proxy\_pass [http://127.0.0.1:9080/app1](http://127.0.0.1:9080/app1);  
}

location ^~ /app2{  
include proxy.conf;  
proxy\_pass [http://127.0.0.1:9080/app2](http://127.0.0.1:9080/app2);  
}

location ^~ /app3 {  
include proxy.conf;  
proxy\_pass [http://127.0.0.1:9080/app3](http://127.0.0.1:9080/app3);  
}

location ^~ /app4{  
include proxy.conf;  
proxy\_pass [http://127.0.0.1:9080/app4](http://127.0.0.1:9080/app4);  
}

location ^~ /app6 {  
include proxy.conf;  
proxy\_pass [http://server1:9081/app6](http://server1:9081/app6);  
}

```
}

```

## }

Now if I comment app3 and app4 app5 works, if I don’t app5 does’t work.  
I get 404 errors. If I check the debug log I see it only checks app1,  
app2, app3 and then it tells me using configuration “”, after which it  
tries to load the file from the file system. I’m not experienced enough  
to see or deduct what is wrong (apparently 🙂 ). So I’m looking for  
pointers to the solution (or even better the solution).

Thanks,  
Marten

Posted at Nginx Forum:

> **[Not all locations considered](https://forum.nginx.org/read.php?2,228885,228885#msg-228885)**
>
> Hi All, For a web application we have developed we wanted to use nginx as a reverse proxy but I have some trouble/weird issues when setting it up. Itseemds that part of my configuration is ignored, it appears it has to do with the order and amount of...

---

<div class="post-metadata">

**Author:** ![mdeinum](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac8455/32.png) [@mdeinum](https://www.ruby-forum.com/u/mdeinum)\
**Post date:** [July 23, 2012, 5:52pm UTC](https://www.ruby-forum.com/t/not-all-locations-considered/221635/2 "2012-07-23T17:52:37Z")

</div>

Hello!

On Mon, Jul 23, 2012 at 11:14:19AM -0400, mdeinum wrote:

> For a web application we have developed we wanted to use nginx as a  
> reverse proxy but I have some trouble/weird issues when setting it up.  
> Itseemds that part of my configuration is ignored, it appears it has to  
> do with the order and amount of locations (but that is at first sight).  
> We use nginx in a windows environment (on our test servers).

[…]

> Now if I comment app3 and app4 app5 works, if I don’t app5 does’t work.  
> I get 404 errors. If I check the debug log I see it only checks app1,  
> app2, app3 and then it tells me using configuration “”, after which it  
> tries to load the file from the file system. I’m not experienced enough  
> to see or deduct what is wrong (apparently 🙂 ). So I’m looking for  
> pointers to the solution (or even better the solution).

This sounds very similar to [#90 (location search tree incorrect on case-insensitive systems) – nginx](http://trac.nginx.org/nginx/ticket/90).

Are you indeed using “/app1”, “/app2” and so on in your config, or  
it’s just masks for some real names with uppercase letters? If  
there are upperacse letters, than using locations in lowercase  
will resolve the issue as suggested in the ticket linked.

Maxim D.

---

<div class="post-metadata">

**Author:** ![mdeinum](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac8455/32.png) [@mdeinum](https://www.ruby-forum.com/u/mdeinum)\
**Post date:** [July 24, 2012, 2:05pm UTC](https://www.ruby-forum.com/t/not-all-locations-considered/221635/3 "2012-07-24T14:05:58Z")

</div>

Thanks. That was indeed the problem, mixing cases doesn’t work reliable  
under windows :s.

Posted at Nginx Forum:

> **[Re: Not all locations considered](https://forum.nginx.org/read.php?2,228885,228930#msg-228930)**
>
> Hi All, For a web application we have developed we wanted to use nginx as a reverse proxy but I have some trouble/weird issues when setting it up. Itseemds that part of my configuration is ignored, it appears it has to do with the order and amount of...
