how to conditionally "if" match a network range?

Ben DJ bendj095124367913213465 at gmail.com
Thu Jun 17 23:17:29 MSD 2010


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



More information about the nginx mailing list