####################################################################### # Add this to your nginx vhost domain's config file within # the location contexts you want to rate limit and/or bot # with 444 - just drop the connection completely # You can also add it to the very top of your host config file # before any of your location contexts and it will apply to the whole site # and all its locations. # BOTS # **** #limit_conn bot1_connlimit 100; limit_conn bot2_connlimit 10; #limit_req zone=bot1_reqlimitip burst=50; limit_req zone=bot2_reqlimitip burst=10; if ($bad_bot = '3') { return 444; } # BAD REFER WORDS # *************** if ($bad_words) { return 444; } # REFERERS # ******** if ($bad_referer) { return 444; } # IP BLOCKS # ********* if ($validate_client) { return 444; } #######################################################################