We block the Chinese
Below is a text worthy of a pen by K.O.
Chinese traffic is great and merciless. When some kind of funny or not very picture gets into Chinese blogs, the colocation provider begins to be offended and talk about the inconsistency of the 3 to 2 ratios of Russian and foreign traffic.
Once again, after catching a nude photoset from one of the projects falling into the open spaces of Chinanet (oh my god, how many popular blogs they have) and considering what this expansion to the east could lead to, I decided to limit our dear yellow-skinned brothers across the planet.
There are several implementation examples (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/en/base/)
Relief on one of the servers.

If you need to close yourself from all, leaving several countries, then such an implementation of UPD will help ! In this case it is more correct to issue 444, thanks rolltin
Chinese traffic is great and merciless. When some kind of funny or not very picture gets into Chinese blogs, the colocation provider begins to be offended and talk about the inconsistency of the 3 to 2 ratios of Russian and foreign traffic.
Once again, after catching a nude photoset from one of the projects falling into the open spaces of Chinanet (oh my god, how many popular blogs they have) and considering what this expansion to the east could lead to, I decided to limit our dear yellow-skinned brothers across the planet.
There are several implementation examples (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/en/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 yourself from all, leaving several countries, then such an implementation of UPD will help ! In this case it is more correct to issue 444, thanks rolltin
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;
}
...
}