Some basic rate limiting

This commit is contained in:
Martin Mahner 2014-12-12 21:25:43 +00:00
parent 459e60a138
commit 51d9d6a8a7

View file

@ -1,3 +1,5 @@
limit_req_zone $binary_remote_addr zone=login:10m rate=1r/s;
upstream app_server { upstream app_server {
server 127.0.0.1:12000 fail_timeout=0; server 127.0.0.1:12000 fail_timeout=0;
} }
@ -73,6 +75,9 @@ server {
} }
location / { location / {
limit_req zone=login burst=5;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
proxy_redirect off; proxy_redirect off;