locations with regex

Alejandro Vartabedian lists at webservice.com.uy
Tue Oct 23 00:58:40 MSD 2007


Hello all, Igor,
    First of all, congrats Igor for nginx, the most enlightened and
powerful web server/proxy i've used. My notebook doesn't swap any more ;-)
    I'm having some problem with regexed location in my config, and can
catch it.
    I have a named server and 2 (or more) subdirs that represent php
apps, those apps have some url rewrite rules, so as a lazy programmer, i
like to define a flexible location rule to map all my apps subdirs
(app1|app2|...), but it seems like the rule is not matched.
two conf examples:

        location /app1/ {
            root   /home/website/beta.ws/webroot/;
            index  index.php index.html index.htm;
            include  /etc/nginx/cakephp_rewrite_rules;
        }

        location /app2/ {
            root   /home/website/beta.ws/webroot/;
            index  index.php index.html index.htm;
            include  /etc/nginx/cakephp_rewrite_rules;
        }

works ok, but something like:

        location ^~ /(app1|app2)/ {
            root   /home/website/beta.ws/webroot/;
            index  index.php index.html index.htm;
            include  /etc/nginx/cakephp_rewrite_rules;
        }
 
doesn't...
i've read http://wiki.codemongers.com/NginxHttpCoreModule#location but
didn't get any progress..

any help is wellcome.





More information about the nginx mailing list