how to conditionally "if" match a network range?

Oleksandr V. Typlyns'kyi wangsamp at gmail.com
Thu Jun 17 23:36:19 MSD 2010


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



More information about the nginx mailing list