Welcome! Log In Create A New Profile

Advanced

Mapping a User Agent to an IP address:

Engin Akyol
February 20, 2012 02:30AM
Hey guys,

I'm running NGINX as a front for my apache servers and I'm having
issues where mappings within the config on occasion aren't being set.
For instance with the following config:

func $my_ip_match{
default 0;
1.1.1.1/32 1;
1.1.1.2/32 1;
1.1.1.3/32 1;
1.1.1.4/32 1;
}

#map the matches
map $name $match_value {
default 0;
~*name_1 $my_ip_match;
~*name_2 $my_ip_match;
~*name_3 $my_ip_match;
~*name_4 $my_ip_match;
}

$my_ip_match will be set if the given IP/subnet is matched, but the
subsequent mapping is randomly executed. I haven't been able to come
up with any reason why it ocassionally doesn't map. Is there any
reason for this?

Thanks in advance!
/Engin

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

Mapping a User Agent to an IP address:

Engin Akyol February 20, 2012 02:30AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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