Welcome! Log In Create A New Profile

Advanced

map module regular expression help

Dick Middleton
August 26, 2011 07:50AM
Hi,

In the wiki for the map module (http://wiki.nginx.org/HttpMapModule) the
following is given as an example:

map $uri $myvalue {
/aa /mapped_aa;
~^/aa/(?<suffix>.*)$ /mapped_bb/$suffix;
}


The second form, the regex, I can't get to work - it returns the literal text
rather than substituting for $suffix.

from my map block:

map $uri $locn {
~^/pdns(?<suffix>.*)$ /var/www/pdns$suffix;
}

the I rewrite:

rewrite ^ $locn;

from the log:

open() "/var/www/pdns$suffix" failed

How do I get this to substitute?

This is using nginx/1.1.0 on debian squeeze.

Dick

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

map module regular expression help

Dick Middleton August 26, 2011 07:50AM

Re: map module regular expression help

Igor Sysoev August 26, 2011 08:04AM

Re: map module regular expression help

Dick Middleton August 26, 2011 12:06PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 275
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready