Skip to content

Instantly share code, notes, and snippets.

@s00d
Forked from skaag/limt_req_zone_whitelist
Last active March 20, 2018 08:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save s00d/1c732da99758ce98a485fa0cd41a62c2 to your computer and use it in GitHub Desktop.
Save s00d/1c732da99758ce98a485fa0cd41a62c2 to your computer and use it in GitHub Desktop.
A way to whitelist certain IP ranges from limit_req_zone in nginx
geo $limited {
default 1;
127.0.0.1 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