IP block by country

1

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 :
https://www.hostingfilters.com/banspam/country.html

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: 107.218.189.168, like this : deny 107.218.189.168;

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 :

https://support.yoorshop.hosting/knowledgebase/3077/You-are-under-ddos-attack.html

 

To know, at app level :
For Prestashop, block by countries :
http://doc.prestashop.com/display/PS16/Geolocation+Preferences 
https://mypresta.eu/modules/administration-tools/block-ip-free 
Wordpress :
https://fr.wordpress.org/plugins/iq-block-country/