Last active
August 29, 2015 14:13
-
-
Save adamenger/9958c394ae0ebbf2178b to your computer and use it in GitHub Desktop.
limit_req_zone in nginx.conf
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
http { | |
... # your nginx.conf here | |
# Maps ip address to $limit variable if request is of type POST | |
map $request_method $limit { | |
default ""; | |
POST $binary_remote_addr; | |
} | |
# Creates 10mb zone in memory for storing binary ips | |
limit_req_zone $limit zone=my_zone:10m rate=1r/s; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment