# GeoIP Country Filtering

**URL:** <https://www.ruby-forum.com/t/geoip-country-filtering/226427>\
**Category:** NGINX\
**Created:** [November 29, 2012, 9:51pm UTC](https://www.ruby-forum.com/t/geoip-country-filtering/226427 "2012-11-29T21:51:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![AJ\_Weber](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/8c91f0/32.png) [@AJ\_Weber](https://www.ruby-forum.com/u/AJ_Weber)\
**Post date:** [November 29, 2012, 9:51pm UTC](https://www.ruby-forum.com/t/geoip-country-filtering/226427/1 "2012-11-29T21:51:53Z")

</div>

Does anyone have any “best practices” on filtering using the GeoIP  
variables?

I’d like to filter my entire site based upon “allowed countries” (it’s a  
very specialized site), and am wondering the best place to check  
country-code so that it’s efficient (performance wise), and applies to  
the entire http or server block.

Any tips and tricks are very much appreciated!

-AJ
