Below is the text worthy of the pen K.O.
Chinese traffic is great and merciless. When some funny or not so picture gets into Chinese blogs, the colocation provider starts to be offended and tell about the discrepancy between the 3 to 2 ratios of Russian and foreign traffic.
Once again, having hit a nude photoset from one of the projects on the Chaynanet’s expanses (oh my, how many popular blogs they have) and considering what this expansion could take to the east, he decided to limit our highly respected yellow-skinned brothers around the planet.
')
There are several examples of the implementation (ngx_http_geo_module, ngx_http_geoip_module or the usual deny), the most effective using ngx_http_geo_module and the wipmania database (http://www.wipmania.com/ru/base/)
Relief on one of the servers.

http {
...
geo $geo {
include geoip.conf;
default XX;
}
}
server {
if ($geo = CN)
{
return 403;
}
...
}
If you need to close from everyone, leaving a few countries, then this implementation will help
server {
...
#
set $a 0;
if ($geo = RU)
{
set $a 1;
}
if ($geo = UA)
{
set $a 1;
}
# ip
if ($geo = XX)
{
set $a 1;
}
if ($a = 0)
{
return 403;
}
...
}
UPD! In this case, it is more correct to issue 444, thanks
rolltin