Skip to content

Instantly share code, notes, and snippets.

@johnroyer
Created April 28, 2025 09:52
Show Gist options
  • Save johnroyer/c41dd6030065a274376fcc16af5a8722 to your computer and use it in GitHub Desktop.
Save johnroyer/c41dd6030065a274376fcc16af5a8722 to your computer and use it in GitHub Desktop.
Nginx config example for blocking bots
server {
if ($http_user_agent ~* (mj12bot|ahrefs|imagesift|BLEXBot|webmeup|toutiao|semrush|petalsearch|dataforseo)) {
return 402;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment