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
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