Forum: NGINX location workflow question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
B7373d9bcdb35f86fefb4c8c140b479a?d=identicon&s=25 euhost.net - matevz sernc-urban (Guest)
on 2009-02-21 01:35
(Received via mailing list)
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;

         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
F5a6ed477b109fe6acc11a5a8f87e7e8?d=identicon&s=25 mike (Guest)
on 2009-02-21 01:44
(Received via mailing list)
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 - matevz sernc-urban
A8108a0961c6087c43cda32c8616dcba?d=identicon&s=25 Maxim Dounin (Guest)
on 2009-02-21 02:08
(Received via mailing list)
Hello!

On Sat, Feb 21, 2009 at 01:24:38AM +0100, 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 Dounin
B7373d9bcdb35f86fefb4c8c140b479a?d=identicon&s=25 euhost.net - matevz sernc-urban (Guest)
on 2009-02-21 10:00
(Received via mailing list)
Maxim Dounin 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 Dounin
>

Thats the key!

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

Thanks!

Matevz Sernc-Urban
This topic is locked and can not be replied to.