map within a map

Igor Sysoev igor at sysoev.ru
Thu Oct 23 20:59:19 UTC 2014


On 23 Oct 2014, at 21:17, itpp2012 <nginx-forum at nginx.us> wrote:

> Can I use multiple maps with a single map ?
> 
> For example;
> 
> map $ngxvar1 $myvar1 {
> default 0;
> ~*string 1;
> }
> map $ngxvar2 $myvar2 {
> default 0;
> ~*string 1;
> }
> map $ngxvar3 $myvar3 {
> default 0;
> ~*string 1;
> $myvar1 1;
> $myvar2 1;
> }
> 
> This way I would only have one IF $myvar3 ....., but obviously this example
> doesn't work, is this possible ?

You can try other path:

map $ngxvar1  $myvar1 {
   default   $myvar2;
   ~*string  1;
}


map $ngxvar2  $myvar2 {
   default   0;
   ~*string  1;
}


-- 
Igor Sysoev
http://nginx.com



More information about the nginx mailing list