# Location workflow question

**URL:** <https://www.ruby-forum.com/t/location-workflow-question/160931>\
**Category:** NGINX\
**Created:** [February 21, 2009, 1:35am UTC](https://www.ruby-forum.com/t/location-workflow-question/160931 "2009-02-21T01:35:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![euhost.netSmatevz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/bbce88/32.png) [@euhost.netSmatevz](https://www.ruby-forum.com/u/euhost.netSmatevz)\
**Post date:** [February 21, 2009, 1:35am UTC](https://www.ruby-forum.com/t/location-workflow-question/160931/1 "2009-02-21T01:35:26Z")

</div>

Hello

i have here a configuration, where a request to  
/forum/viewforum-18-bla.php is not parsed by php.

My Question is: why doesnt the “location ~ .php$” get’s executed after  
the “location ^~ /forum/” is finished?

server is nginx 0.7.35 with fastcgi/php-cgi.

Here is my simplified non-working config file:

server {  
listen 192.168.1.2:80;  
server\_name [www.domain.com](http://www.domain.com);

```
     location / {
         root html;
         index index.html index.php;
     }

     location ^~ /forum/ {
          rewrite ^/forum/viewforum-18-bla.php$

```

/forum/viewforum.php?id=18 last;  
}

```
     location ~ .php$ {
         fastcgi_pass 127.0.0.1:8888;
         include fastcgi_params;
     }

```

}

my config would work, if i duplicate the fastcgi\_pass directive in  
“location ^~ /forum/”. But is this duplication really needed?

Thanks for an advice.

And keep up the good work with nginx!  
Matevz Sernc-Urban

---

<div class="post-metadata">

**Author:** ![euhost.netSmatevz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/bbce88/32.png) [@euhost.netSmatevz](https://www.ruby-forum.com/u/euhost.netSmatevz)\
**Post date:** [February 21, 2009, 1:44am UTC](https://www.ruby-forum.com/t/location-workflow-question/160931/2 "2009-02-21T01:44:49Z")

</div>

sadly, i believe so. i wind up having to do that, and it was under  
igor’s advisement.

On Fri, Feb 20, 2009 at 4:24 PM, [euhost.net](http://euhost.net) - matevz sernc-urban

---

<div class="post-metadata">

**Author:** ![euhost.netSmatevz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/bbce88/32.png) [@euhost.netSmatevz](https://www.ruby-forum.com/u/euhost.netSmatevz)\
**Post date:** [February 21, 2009, 2:08am UTC](https://www.ruby-forum.com/t/location-workflow-question/160931/3 "2009-02-21T02:08:14Z")

</div>

Hello!

On Sat, Feb 21, 2009 at 01:24:38AM +0100, [euhost.net](http://euhost.net) - matevz  
sernc-urban wrote:

> Hello
> 
> i have here a configuration, where a request to  
> /forum/viewforum-18-bla.php is not parsed by php.
> 
> My Question is: why doesnt the “location ~ .php$” get’s executed after  
> the “location ^~ /forum/” is finished?

Any reason why it should? URI in question is mathched by  
“location ^~ /forum/” and regex location processing forbidden  
after this location (note ^~).

Maxim D.

---

<div class="post-metadata">

**Author:** ![euhost.netSmatevz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/bbce88/32.png) [@euhost.netSmatevz](https://www.ruby-forum.com/u/euhost.netSmatevz)\
**Post date:** [February 21, 2009, 10:00am UTC](https://www.ruby-forum.com/t/location-workflow-question/160931/4 "2009-02-21T10:00:54Z")

</div>

Maxim D. schrieb:

> > the “location ^~ /forum/” is finished?
> 
> Any reason why it should? URI in question is mathched by  
> “location ^~ /forum/” and regex location processing forbidden  
> after this location (note ^~).
> 
> Maxim D.

Thats the key!

I changed the directive to “location ~ ^/forum/” and now both location’s  
are processed one after another.

Thanks!

Matevz Sernc-Urban
