Skip to content

Instantly share code, notes, and snippets.

@tqyq
Created November 24, 2015 02:34
Show Gist options
  • Save tqyq/297282974ae115d8f94a to your computer and use it in GitHub Desktop.
Save tqyq/297282974ae115d8f94a to your computer and use it in GitHub Desktop.
nginx limit api rate
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