Welcome! Log In Create A New Profile

Advanced

Variable interpolation in a regex.

Harish Sundararaj
September 04, 2012 03:56PM
Hello All,

I have a map block:

map $http_cookie $myVal {
"~adq_cnv(\d+)=($cmpid[^;]+#(?P<DC>\w{2}))(?:;|$)" $DC;
default "XYZ";
}

The $cmpid used in the left side of a map is to be interpolated from a
location block :

location ~ ^/cnv/(\d+)/ {
set $cmpid $1;
...
}

But that is not working. I tried different variations like : ${cmpid},
\$cmpid . But to no luck.

Any help would be appreciated.

Thanks
Harish

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

Variable interpolation in a regex.

Harish Sundararaj September 04, 2012 03:56PM

Re: Variable interpolation in a regex.

VBart September 04, 2012 04:04PM

Re: Variable interpolation in a regex.

Harish Sundararaj September 04, 2012 04:48PM

Re: Variable interpolation in a regex.

xav April 10, 2020 05:44AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 244
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