markusthoemmes closed pull request #3342:  #3168 Rate limit requests to 
download CLI, Docker and iOS SDKs
URL: https://github.com/apache/incubator-openwhisk/pull/3342
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/ansible/roles/nginx/templates/nginx.conf.j2 
b/ansible/roles/nginx/templates/nginx.conf.j2
index c31026cc66..bc19edb34e 100644
--- a/ansible/roles/nginx/templates/nginx.conf.j2
+++ b/ansible/roles/nginx/templates/nginx.conf.j2
@@ -9,6 +9,9 @@ events {
 }
 
 http {
+{# nginx rate limit config parameters #}
+    limit_req_zone $binary_remote_addr zone=mylimit:10m rate=10r/s;
+    
 {# allow large uploads, need to thread proper limit into here #}
     client_max_body_size 50M;
 
@@ -94,18 +97,26 @@ http {
         }
 
         location /blackbox.tar.gz {
+            limit_req zone=mylimit burst=20 nodelay;
+            
             return 301 
https://github.com/apache/incubator-openwhisk-runtime-docker/releases/download/sdk%400.1.0/blackbox-0.1.0.tar.gz;
         }
         # leaving this for a while for clients out there to update to the new 
endpoint
         location /blackbox-0.1.0.tar.gz {
+            limit_req zone=mylimit burst=20 nodelay;
+            
             return 301 /blackbox.tar.gz;
         }
 
         location /OpenWhiskIOSStarterApp.zip {
+            limit_req zone=mylimit burst=20 nodelay;
+            
             return 301 
https://github.com/apache/incubator-openwhisk-client-swift/releases/download/0.2.3/starterapp-0.2.3.zip;
         }
 
         location /cli/go/download {
+            limit_req zone=mylimit burst=20 nodelay;
+            
             autoindex on;
             root /etc/nginx;
         }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to