No subject

Software Info softwareinfojam at gmail.com
Sat Apr 13 02:24:01 UTC 2019


Hi All
I have implemented GEO IP blocking which is working just fine. I have the settings you see below. 

    map $geoip_country_code $country_access {
        "US"    0;
        default 1;
    }

    server {
         if ($country_access = '1') {
         return 403;
         }

I notice though that in the logs, the internal IP Addresses are not tagged with a country code so internal subnets are getting blocked. Would the correct solution be to enter the subnets manually such as this config below? Or is there a better solution? Oh by the way, I did try this below and it didn’t work. Trying to keep the Geographical blocking but allow some IP ranges. Any ideas on how to do this? Any help would be appreciated.
   
 map $geoip_country_code $country_access {
        "US"    0;
       ‘192.168.1.0/24’ 0;
        default 1;
    }


Regards
SI


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20190412/10430e2d/attachment-0001.html>


More information about the nginx mailing list