Created
February 26, 2025 18:47
-
-
Save felipekm/b20f15eae85e36650e12e547a6fdde92 to your computer and use it in GitHub Desktop.
NGINX rate limiter - Prevent excessive API requests from a single IP or user
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 { | |
limit_req_zone $binary_remote_addr zone=api_limit:10m rate=10r/s; | |
server { | |
location /api/ { | |
limit_req zone=api_limit burst=20 nodelay; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment