• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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