install

yum install geoip-database libgeoip1

cd /nginx/path/

./configure --with-http_geoip_module

nginx configs

location = /a.php{
        if ($geoip_country_code = JP) {
            return 504;
            #why the http status code is 504 ? 
            #cause the others code will keep run blow
        }
        include fcgi.conf;
        fastcgi_pass  127.0.0.1:9000;
 }

sources

[geoip] : http://www.cyberciti.biz/faq/linux-unix-nginx-geoip-module-configuration/