Created
June 15, 2016 18:07
-
-
Save kanibaspinar/b22291585c506d44349ba822dfefdc5d to your computer and use it in GitHub Desktop.
Prevention of new types of Http Get Flood attacks at Layer 7 with nginx
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
# | |
# Hello provide protection for these settings http get flood attacks. | |
# Please add this rule to the appropriate sections in your default.conf file. | |
# Please note that the server {} function does not take place in part become invalid | |
# | |
set $add 1; | |
set $ban ''; | |
###### Rule 1 ######## | |
if ($http_referer = '-' ) { | |
set $ban $ban$add; | |
} | |
if ($request_uri = '/') { | |
set $ban $ban$add; | |
} | |
if ($http_user_agent = 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US)') { | |
set $ban $ban$add; | |
} | |
if ($ban = 111) { | |
return 444; | |
} | |
#Have a nice day# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment