• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question Blocking bad bots

tkalfaoglu

Silver Pleskian
The server seems to be mainly servicing https bots while its running, and it annoyed me.
So I wrote some nginx code to stop it (inserted via the PLESK interface into the nginx configurations box):

if ($http_user_agent ~ (MJ12bot|LieBaoFast|UCBrowser|MQQBrowser|Mb2345Browser|gumgum-bot|postmanruntime|ag_dm_spider|scrapy|chimebot|trendkite-akashic-crawler|ZoominfoBot|Sogou|ALittle|Keybot|Buck|curl|webprosbot|RestSharp|Snap|SemrushBot|AhrefsBot|DataForSeoBot)) {
return 403;
}


It appears to work, but how can I enable this for ALL sites.. I tried it in nginx.conf , but it complained that "if" cannot be put there..
Thanks! -t
 
You could also add this inside your ModSecurity.
That way if 1 site gets "attacked", it's blocked all across your server.
 
Thanks - in the past I had problems with modsecurity - blocking things it should not have, so I'm a bit shy about using it
 
Back
Top