From 24365fb960ebffa4102da569b142e88f19691e76 Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Mon, 26 Jan 2015 15:42:56 -0500 Subject: [PATCH] nginx: rate-limiting for /c1/ --- conf/proxy-server-base.conf | 2 ++ conf/rate-limiting.conf | 1 + 2 files changed, 3 insertions(+) diff --git a/conf/proxy-server-base.conf b/conf/proxy-server-base.conf index 32606748e..fb2f3f962 100644 --- a/conf/proxy-server-base.conf +++ b/conf/proxy-server-base.conf @@ -62,6 +62,8 @@ location /c1/ { proxy_pass http://verbs_app_server; proxy_read_timeout 2000; proxy_temp_path /var/log/nginx/proxy_temp 1 2; + + limit_req zone=api burst=5 nodelay; } location /static/ { diff --git a/conf/rate-limiting.conf b/conf/rate-limiting.conf index be431be41..3e2538510 100644 --- a/conf/rate-limiting.conf +++ b/conf/rate-limiting.conf @@ -2,5 +2,6 @@ limit_req_zone $proxy_protocol_addr zone=webapp:10m rate=25r/s; limit_req_zone $proxy_protocol_addr zone=repositories:10m rate=1r/s; +limit_req_zone $proxy_protocol_addr zone=api:10m rate=1r/s; limit_req_status 429; limit_req_log_level warn;