August 2017
Intermediate to advanced
278 pages
8h 53m
English
There are a number of aspects to this recipe to consider. The first is the limit_req_zone directive within the main NGINX configuration file. We can create multiple zones for tracking and base them on different tracking parameters. In our recipe, we used $binary_remote_addr to track the remote IP address. The second parameter is then the name of the zone and the memory to allocate. We called the basiclimit zone and allocated 10 MB to it, which is sufficient to track up to 160,000 IP addresses. The third parameter is the rate, which we set to 10 requests per second (10r/s).
Read now
Unlock full access