How to conditionally "if" match a network range?

hi,

this works fine,

if ($remote_addr = 1.2.3.4) {

}

i’d like to match, rather than on a single IP, to a network range. in
effect,

if ($remote_addr = 1.2.3.0/24) {

}

but, afaict, that doesn’t work.

is there a way to conditionally match $remote_addr against a network
range?

thanks,

bendj

Today Jun 17, 2010 at 12:17 Ben DJ wrote:

i’d like to match, rather than on a single IP, to a network range. in effect,

if ($remote_addr = 1.2.3.0/24) {

}

but, afaict, that doesn’t work.

http://wiki.nginx.org/NginxHttpGeoModule

geo $mysubnet {
default 0;
1.2.3.0/24 1;
}

if ($mysubnet) {

}


WNGS-RIPE

On Thu, Jun 17, 2010 at 12:36 PM, Oleksandr V. Typlyns’kyi
[email protected] wrote:

http://wiki.nginx.org/NginxHttpGeoModule

Perfect! Looking in the wrong place – again …

Thanks!

BenDJ