From 51d9d6a8a7024b76243af6c1938d7df6a7b60d38 Mon Sep 17 00:00:00 2001 From: Martin Mahner Date: Fri, 12 Dec 2014 21:25:43 +0000 Subject: [PATCH] Some basic rate limiting --- server/nginx.conf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/nginx.conf b/server/nginx.conf index 1dcd017..2fcfd6a 100644 --- a/server/nginx.conf +++ b/server/nginx.conf @@ -1,3 +1,5 @@ +limit_req_zone $binary_remote_addr zone=login:10m rate=1r/s; + upstream app_server { server 127.0.0.1:12000 fail_timeout=0; } @@ -73,6 +75,9 @@ server { } location / { + + limit_req zone=login burst=5; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off;