Rate limit the catalog endpoint by auth token and IP address

This commit is contained in:
Joseph Schorr 2018-06-05 17:31:11 -04:00
parent 2e0edf8f6e
commit ef167ab7e3
3 changed files with 8 additions and 7 deletions

View file

@ -75,6 +75,12 @@ location ~ ^/(v1/repositories|v2/auth)/ {
limit_req zone=repositories burst=10;
}
location ~ ^/v2/_catalog(.*)$ {
proxy_pass http://registry_app_server;
proxy_read_timeout 10;
limit_req zone=catalog;
}
location /secscan/ {
proxy_pass http://jwtproxy_secscan;
}
@ -136,10 +142,6 @@ location ~ ^/v2 {
client_max_body_size {{ maximum_layer_size }};
}
location /v2/_catalog {
return 400;
}
location ~ ^/v1 {
# Setting ANY header clears all inherited proxy_set_header directives
proxy_set_header X-Forwarded-For $proper_forwarded_for;