From b2e4fea68632fbca37008425457d468bb61df158 Mon Sep 17 00:00:00 2001 From: Darren Govoni Date: Fri, 22 Oct 2021 08:21:18 -0400 Subject: [PATCH] Add rate limiting --- conf/nginx.conf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/conf/nginx.conf b/conf/nginx.conf index 101c31f0..4147d649 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -15,6 +15,9 @@ http { #include /etc/nginx/fastcgi.conf; index index.html index.htm index.php; + limit_req_zone $binary_remote_addr zone=one:10m rate=40r/m; + limit_conn_zone $binary_remote_addr zone=addr:10m; + default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] $status ' @@ -37,6 +40,8 @@ http { access_log logs/balsam.access.log main; location / { + + limit_req zone=one burst=15; proxy_pass http://balsam; include uwsgi_params;