Welcome! Log In Create A New Profile

Advanced

(no subject)

Software Info
April 12, 2019 10:26PM
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


_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

(no subject)

Software Info April 12, 2019 10:26PM

Re: [no subject]

daBee April 13, 2019 08:10AM

Re: your mail (GEO IP blocking)

Francis Daly April 17, 2019 08:40AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 257
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready