Created
November 24, 2015 02:34
-
-
Save tqyq/297282974ae115d8f94a to your computer and use it in GitHub Desktop.
nginx limit api rate
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
http { | |
limit_req_zone $binary_remote_addr zone=www:10m rate=1r/s; | |
} | |
server { | |
#limit in server or location | |
#limit_req zone=www burst=5 nodelay; | |
location ~ .*\.php($|/) { | |
limit_req zone=www burst=5 nodelay; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment