sunsunshining
Verified User
- Joined
- Sep 23, 2024
- Messages
- 29
I tried to block some bots in a mixed nginx_apache mode by adding the following block to "nginx.conf proxy" for a domain via custom-httpd → Customize → Paste below code in first box → Save → DA Build rewrite configs.
But this did not seem to block them when checking the log.
But this did not seem to block them when checking the log.
Code:
if ($http_user_agent ~* (Amazonbot|anthropic-ai|Applebot|Applebot-Extended|AwarioRssBot|AwarioSmartBot|Bytespider|CCBot|ChatGPT|ChatGPT-User|Claude-Web|ClaudeBot|cohere-ai|DataForSeoBot|Diffbot|FacebookBot|Google-Extended|GPTBot|ImagesiftBot|magpie-crawler|omgili|Omgilibot|peer39_crawler|PerplexityBot|SemrushBot|Yandex|YandexBot|YouBot)) {
return 403;
}