This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
quay/conf/rate-limiting.conf

17 lines
651 B
Text
Raw Normal View History

# vim: ft=nginx
2015-02-19 21:24:05 +00:00
# Check the Authorization header and, if it is empty, use their proxy protocol
# IP, else use the header as their unique identifier for rate limiting.
# Enterprise users will never be using proxy protocol, thus the value will be
# empty string. This means they will not get rate limited.
map $http_authorization $registry_bucket {
"" $proxy_protocol_addr;
default $http_authorization;
}
limit_req_zone $proxy_protocol_addr zone=webapp:10m rate=25r/s;
2015-01-26 20:42:56 +00:00
limit_req_zone $proxy_protocol_addr zone=api:10m rate=1r/s;
2015-02-19 21:24:05 +00:00
limit_req_zone $registry_bucket zone=repositories:10m rate=1r/s;
limit_req_status 429;
limit_req_log_level warn;