The HttpMapModule documentation states that:
Since 1.0.4, case insensitive regular expressions can be used by prefixing the pattern with ~*.
And gives the example:
map $uri $myvalue {
/aa /mapped_aa;
~^/aa/(?<suffix>.*)$ $suffix;
}
I updated to nginx/1.2.7
to make use of this, and naive regexes work okay, but variables don't. When I try the above syntax I get the error:
nginx: [emerg] pcre_compile() failed: unrecognized character after (?< in "^/aa/(?<suffix>.*)$" at "suffix>.*)$"
I also tried the following syntaxes, but none of them worked:
~^(.*)$ $1;
~^(.*)$ \1;
but neither of them worked either.
Does anyone know how to get variables to work in regular expressions in HttpMapModule?