changeset 725:e5b1495299bd

Tests: made sure to test limit_conn with rate limited request.
author Sergey Kandaurov <pluknet@nginx.com>
date Thu, 01 Oct 2015 12:45:58 +0300
parents 4322541b80ed
children 22b06c04b37f
files limit_conn_complex.t
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/limit_conn_complex.t
+++ b/limit_conn_complex.t
@@ -40,6 +40,7 @@ http {
     %%TEST_GLOBALS_HTTP%%
 
     limit_req_zone   $binary_remote_addr$arg_r  zone=req:1m rate=1r/s;
+    limit_req_zone   $binary_remote_addr        zone=re2:1m rate=1r/s;
     limit_conn_zone  $binary_remote_addr$arg_c  zone=conn:1m;
 
     server {
@@ -52,12 +53,16 @@ http {
 
         location /w {
             limit_conn conn 1;
-            proxy_pass http://127.0.0.1:8080/req;
+            proxy_pass http://127.0.0.1:8080/req2;
         }
 
         location /req {
             limit_req  zone=req burst=2;
         }
+
+        location /req2 {
+            limit_req  zone=re2 burst=2;
+        }
     }
 }
 
@@ -83,6 +88,8 @@ ok(IO::Select->new($s)->can_read(0.1), '
 
 # limit_conn tests
 
+http_get('/req2');
+
 $s = http_get('/w', start => 1);
 select undef, undef, undef, 0.2;