mirror of
https://github.com/MAGICGrants/campaign-site.git
synced 2026-01-09 12:27:59 -05:00
chore(nginx): api rate limit
This commit is contained in:
13
nginx.conf
13
nginx.conf
@@ -3,6 +3,8 @@ events {
|
||||
}
|
||||
|
||||
http {
|
||||
limit_req_zone $binary_remote_addr zone=api:10m rate=2r/s;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name donate.magicgrants.org;
|
||||
@@ -15,5 +17,16 @@ http {
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Forwarded-Host $host;
|
||||
}
|
||||
|
||||
location /api {
|
||||
proxy_pass http://app:3000/api;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Forwarded-Host $host;
|
||||
|
||||
limit_req zone=api burst=5 nodelay;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user