IP block by country


On 09/30/2016, due to the persistence of Russian, Chinese, Ukrainian spam traffic and attacks, we implement IP blocking by targeted countries on Europe and Canada offers.

Countries which are blocked by default with nginx template 'YOORshop defaut' : 

Russia China Ukraine Ivoary coast Singapore

Blocked visitor is redirected to :

For those who don't want this protection on their site, you can disable this security :
(If you have real sales business with these countries - not purchases -)

Log in your cPanel admin, go to section 'Nginx', click on 'Nginx-Manager'

Nginx cPanel plugin
Choose first your domain and click 'Configure'
To change profile, you must leave 'PROXY' and click 'Select'
Leave httpd, and see dropdown list below text : 'Template'
Choose in this case template 'YOORshop country', and click 'Apply upstream configuration'

(Wait 1 minute so that server will now take into account this modification)

Particular case :
Your are yourself located in one of the blocked countries and you want to keep this protection, but be able to see your site, you must use a VPN YOORshop :OpenVPN ou L2TP. Use template Nginx : 'YOORshop Country' to open to all countries from 'APPLICATION SETTINGS'.

If you use Nginx PHP-FPM, you can block IPs not by htaccess, but by user_config of the Nginx-Manager plugin, create a file nginx.conf in main folder of your website, for example add the blocking for the IP:, like this: 

To block world but not France/Belgium/Luxembourg/Switzerland, add :
if ($allowed_country5 = no) {
return 444;

To block China only, add :

if ($allowed_country2 = no) {

return 444;


To block users whose user agent is 'Java' (crawlers mostly) :

if ($scanners2 = 1) {

return 444;


Finally, click the Reload button in the Nginx-Manager plugin application settings (ignore if says invalid), and wait 30-60 seconds before testing

Use plugins and htaccess first, and ask us if needed for custom...

We recommend to activate at same time anti-bot feature : bot_mitigate, see reference :



To know, at app level :
For Prestashop, block by countries :
Wordpress :

Also Read

How to fight against junk bot traffic

We have put a protection server wide with a list of not desired bots. Indeed we remarked that...

How to disable Nginx default security rules

You can disable our Nginx security rules temporarily, or permanently : not recommended except for...

Unsufficient disk space

In order to satisfy existing customers who evolve using a lot of disk space (superior to 80GB)...

Optimal technique for DNS update

The DNS to be inserted for your hosting service are mentioned in the email of access that...

Htaccess directory protection

Go to your cPanel in section Files and click Directory privacy. To secure one of the directories...