How to allow or deny IP with regex or Wildcard in NGINX?

Use CIDR notation.

For example:

allow 192.168.0.0/16;