Skip to content

Commit

Permalink
Adds rate limiting to some views in nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
mouse-reeve committed Jul 15, 2022
1 parent 569e540 commit 143eaf3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions nginx/development
Expand Up @@ -7,6 +7,15 @@ upstream web {
server {
listen 80;

location ~ ^/(login|password-reset|resend-link) {
limit_req zone=loginlimit;

proxy_pass http://web;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
}

location / {
proxy_pass http://web;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand Down
1 change: 1 addition & 0 deletions nginx/server_config
@@ -1 +1,2 @@
client_max_body_size 10m;
limit_req_zone $binary_remote_addr zone=loginlimit:10m rate=1r/s;

0 comments on commit 143eaf3

Please sign in to comment.