mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 03:21:05 +00:00
Adds rate limiting to some views in nginx
This commit is contained in:
parent
569e5400fe
commit
143eaf362d
2 changed files with 10 additions and 0 deletions
|
@ -7,6 +7,15 @@ upstream web {
|
||||||
server {
|
server {
|
||||||
listen 80;
|
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 / {
|
location / {
|
||||||
proxy_pass http://web;
|
proxy_pass http://web;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
client_max_body_size 10m;
|
client_max_body_size 10m;
|
||||||
|
limit_req_zone $binary_remote_addr zone=loginlimit:10m rate=1r/s;
|
||||||
|
|
Loading…
Reference in a new issue