Hi All 
I would really appreciate some help here. I want to restrict all countries
except the US and Jamaica (JM).

load_module "/usr/local/libexec/nginx/ngx_http_geoip_module.so";

These are my entries in nginx.conf

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

Under HTTP Server
     if ($country_access = '1') {
     return 403;
     }

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

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

_______________________________________________
nginx mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx

Reply via email to