Created
October 19, 2017 10:30
-
-
Save joostvanveen/e608c987ac0ca4d4ad371be998b9becd to your computer and use it in GitHub Desktop.
Nginx configuration file for Hypernode to block unwanted bots
This file contains 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
if ($http_user_agent ~ "PHPCrawl|bGenius|SemrushBot|Yandex|YandexBot|MegaIndex|spbot|BLEXBot|ltx71|Daum|SpotBot|DotBot|seoscanners|domaincrawler|CCBot|SeznamBot|SMTBot") { | |
return 403; | |
break; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Better use status 410 and you don't need break after return. More bots are listed here: https://gist.github.com/peterjaap/ab5801152e1d0f874476b47e0c9a4682