Skip to content

Commit 721f63d

Browse files
authored
Merge pull request #144 from psaux-it/rate_l_1
implement rate limiting
2 parents 86fb390 + 04dcfd9 commit 721f63d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

nginx/default.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ server {
121121
fastcgi_index index.php;
122122
fastcgi_pass wordpress-fpm:9001;
123123
include /etc/nginx/fastcgi_params;
124+
125+
limit_req zone=nppp_api burst=5 nodelay; # Apply rate limit; allow burst of 5 with no queuing delay
126+
limit_req_status 429; # Return 429 Too Many Requests instead of default 503
127+
limit_req_log_level warn; # Log rate limit hits as warnings, not errors
128+
124129
fastcgi_cache_bypass $skip_cache;
125130
fastcgi_no_cache $skip_cache;
126131
fastcgi_cache NPP;

0 commit comments

Comments
 (0)