Skip to content

Instantly share code, notes, and snippets.

@johnewart
Created May 27, 2015 19:43
Show Gist options
  • Save johnewart/6d6adeb9f9e0affcf6f4 to your computer and use it in GitHub Desktop.
Save johnewart/6d6adeb9f9e0affcf6f4 to your computer and use it in GitHub Desktop.
limit_req_zone $binary_remote_addr zone=one:100m rate=3r/s;
limit_req_zone $projectid zone=two:100m rate=6r/s;
limit_req_status 429;
limit_req_log_level warn;
server {
listen 80;
location / {
proxy_pass http://internal;
}
location ~* /api/(?P<projectid>\d+/)?store/ {
proxy_pass http://internal;
limit_req zone=one burst=3 nodelay;
limit_req zone=two burst=10 nodelay;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment