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

archweb: rate limit /mirrors/status/json endpoint

This is by far our most popular endpoint and some folks hit us with one
request per 5 seconds which leads to 6GB of daily traffic. Rate limit
them the same as broken RSS readers.
parent e581c85f
No related branches found
No related tags found
1 merge request!834archweb: tweak our rate limits
Pipeline #100460 passed
# limit rss requests to 1 r/m
limit_req_zone $binary_remote_addr zone=rsslimit:8m rate=1r/m;
# limit mirrors/status/json requests to 1 r/m
limit_req_zone $binary_remote_addr zone=mirrorstatuslimit:8m rate=1r/m;
# limit general requests to 10 r/s to block DoS attempts.
limit_req_zone $binary_remote_addr zone=archweblimit:10m rate=10r/s;
......@@ -191,6 +194,19 @@ server {
limit_req zone=rsslimit burst=10 nodelay;
}
# Rate limit mirror status json endpoint
location /mirrors/status/json {
include uwsgi_params;
uwsgi_pass archweb;
uwsgi_cache archwebcache;
uwsgi_cache_revalidate on;
uwsgi_cache_key $cache_key;
add_header X-Cache-Status $upstream_cache_status;
limit_req zone=mirrorstatuslimit burst=10 nodelay;
}
# Temporary redirects
location /people/trusted-user-fellows/ {
return 301 /people/package-maintainer-fellows/;
......
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