if ($remote_addr ~ and set $white_list for subnets?

antikurjers nginx-forum at forum.nginx.org
Sat Dec 28 11:42:30 UTC 2019

I want to mark same subnets to as $white_list. I currently use:

# urdas web
        location / {
        if ($remote_addr ~ "(|(|(") {
        set $white_list a712ba9579080e61cd89955a2cb837bf;
        proxy_set_header WhiteList $white_list;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;

It work well. But works only by one IP address.  How to mark as subnets?

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,286617,286617#msg-286617

More information about the nginx mailing list