Complete the code to define a rate limit zone named 'mylimit' with 10 requests per second.
limit_req_zone $binary_remote_addr zone=mylimit:10m rate=[1]r/s;
The rate parameter sets the allowed requests per second. Here, 10r/s means 10 requests per second.
Complete the code to apply the 'mylimit' zone to limit requests in the server block.
limit_req zone=[1] burst=5 nodelay;
The zone name must match the name defined in limit_req_zone. Here, it is 'mylimit'.
Fix the error in the limit_req_zone directive to correctly set the zone size to 20 megabytes.
limit_req_zone $binary_remote_addr zone=mylimit:[1] rate=10r/s;
The zone size must be specified with a unit. 'm' means megabytes, so '20m' is correct for 20 megabytes.
Fill both blanks to create a limit_req_zone using the client IP and apply a burst of 10 in the limit_req directive.
limit_req_zone [1] zone=iplimit:10m rate=5r/s; limit_req zone=iplimit burst=[2];
The variable $binary_remote_addr is used for client IP in binary form for efficiency. The burst value controls how many requests can exceed the rate temporarily.
Fill all three blanks to define a limit_req_zone with 15r/s rate, apply it with a burst of 7, and enable nodelay.
limit_req_zone [1] zone=fastlimit:15m rate=[2]r/s; limit_req zone=fastlimit burst=[3] nodelay;
The zone key is $binary_remote_addr. The rate is 15 requests per second. The burst is set to 7 to allow some bursts without delay. The nodelay option sends excess requests immediately as errors.