# Using geoip per continent instead of country possible?

**URL:** <https://www.ruby-forum.com/t/using-geoip-per-continent-instead-of-country-possible/218221>\
**Category:** NGINX\
**Created:** [March 25, 2012, 6:21am UTC](https://www.ruby-forum.com/t/using-geoip-per-continent-instead-of-country-possible/218221 "2012-03-25T06:21:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [March 25, 2012, 6:21am UTC](https://www.ruby-forum.com/t/using-geoip-per-continent-instead-of-country-possible/218221/1 "2012-03-25T06:21:00Z")

</div>

Hello guys…

I need to perform a specific action for Asia countries… is there  
anyway to use GeoIP per continent instead of specifying a seperate IF  
for every Asian country?

Thanks  
–Mike

---

<div class="post-metadata">

**Author:** ![Micheal\_W](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac8455/32.png) [@Micheal\_W](https://www.ruby-forum.com/u/Micheal_W)\
**Post date:** [March 25, 2012, 11:22am UTC](https://www.ruby-forum.com/t/using-geoip-per-continent-instead-of-country-possible/218221/2 "2012-03-25T11:22:46Z")

</div>

On Sun, Mar 25, 2012 at 04:20:16AM +0000, Micheal W. wrote:

> Hello guys…
> 
> I need to perform a specific action for Asia countries… is there anyway to use  
> GeoIP per continent instead of specifying a seperate IF for every Asian country?

You can convert GeoIP base to nginx geo module custom map.  
Please read this:

> **[Country banning](http://mailman.nginx.org/pipermail/nginx/2009-August/014705.html)**

> **[Country banning](http://mailman.nginx.org/pipermail/nginx/2009-August/014707.html)**

> **[Country banning](http://mailman.nginx.org/pipermail/nginx/2009-August/014710.html)**

–  
Igor S.

---

<div class="post-metadata">

**Author:** ![Micheal\_W](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ac8455/32.png) [@Micheal\_W](https://www.ruby-forum.com/u/Micheal_W)\
**Post date:** [March 25, 2012, 9:27pm UTC](https://www.ruby-forum.com/t/using-geoip-per-continent-instead-of-country-possible/218221/3 "2012-03-25T21:27:23Z")

</div>

untested, but would this work?

map $geoip\_city\_country\_code $continent {  
RUS Asia;  
…  
}
