mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2025-07-16 09:38:49 +02:00
fix:#7 added limit to POST in nginx config
This commit is contained in:
@ -108,6 +108,12 @@ http {
|
||||
1 $binary_remote_addr;
|
||||
}
|
||||
|
||||
# Different rate limits for different request methods
|
||||
map $request_method $limit_zone {
|
||||
POST createFeed; # Create feed is limited to 1 request per minute
|
||||
default feed; # All other requests are limited to 20 requests per minute
|
||||
}
|
||||
|
||||
# Limit the number of requests per IP
|
||||
limit_req_zone $limit_key zone=feed:20m rate=20r/m;
|
||||
limit_req_zone $limit_key zone=createFeed:10m rate=1r/m;
|
||||
@ -136,7 +142,8 @@ http {
|
||||
proxy_read_timeout 600s;
|
||||
proxy_send_timeout 600s;
|
||||
send_timeout 600s;
|
||||
limit_req zone=feed burst=10 nodelay;
|
||||
limit_req zone=$limit_zone burst=10 nodelay;
|
||||
limit_req_status 429;
|
||||
}
|
||||
|
||||
location /api {
|
||||
|
Reference in New Issue
Block a user