Skip to content
Snippets Groups Projects
Verified Commit 8bf73311 authored by Jelle van der Waa's avatar Jelle van der Waa :construction:
Browse files

Set a 10req/s rate limit for the wiki's php-fpm endpoint

parent d1259285
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,10 @@ fastcgi_cache_key "$scheme$request_method$host$request_uri";
# rate limit API endpoint
limit_req_zone $binary_remote_addr zone=api_zone:10m rate=5r/s;
# limit general requests to 10 r/s to block DoS attempts with a burst of 10.
limit_req_zone $binary_remote_addr zone=archwikilimit:10m rate=10r/s;
limit_req_status 429;
upstream archwiki {
......@@ -104,6 +108,8 @@ server {
fastcgi_pass archwiki;
fastcgi_index index.php;
include fastcgi.conf;
limit_req zone=archwikilimit burst=10 nodelay;
}
# whitelist known OK directories
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment