-
-
Save enes-oerdek/c91318e7c55b9bc1dbc9717e42dee153 to your computer and use it in GitHub Desktop.
A way to whitelist certain IP ranges from limit_req_zone in nginx
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
geo $limited { | |
default 1; | |
# Wordpress Jetpack ranges: | |
192.0.0.0/16 0; | |
66.135.0.0/16 0; | |
66.155.0.0/16 0; | |
76.74.0.0/16 0; | |
} | |
map $limited $limit { | |
1 $binary_remote_addr; | |
0 ""; | |
} | |
limit_req_zone $limit zone=apizone:5m rate=30r/m; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment