Created
April 28, 2025 09:52
-
-
Save johnroyer/c41dd6030065a274376fcc16af5a8722 to your computer and use it in GitHub Desktop.
Nginx config example for blocking bots
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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