Last active
January 18, 2018 02:32
-
-
Save StevenJL/f75a87dade15b671ab5bace0c37768e1 to your computer and use it in GitHub Desktop.
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 { | |
# The `limit_req_zone` directive here prevents a single ip | |
# address from making more than 30 requests per minute. | |
# The `$binary_remote_addr` tells nginx to use the remote address | |
# as the "key" for rate limiting. The zone is used to define a | |
# name and size where excessive requests are stored. | |
limit_req_zone $binary_remote_addr zone=my_zone:12m rate=30r/m; | |
location /do_not_dos_plz { | |
# `limit_req` can also be used to within `location` blocks | |
# using the `limit_req` directive. | |
limit_req zone=my_zone | |
} | |
} | |
# vi: ft=nginx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment