What you’ll need
Before you dive in, make sure you have the following prerequisites in place:- A bunny.net account (Log in or sign up for a free trial).
- An existing Shield Zone.
- Advanced Plan or above on the existing Shield Zone (if creating more than 2 rate limit rules*).
Creating a Ratelimit Rule
To create an effective rate limit rule, it’s important to understand the fundamentals of how to build a Custom WAF Rule on Bunny Shield. Familiarize yourself with our Rule Engine documentation to gain insights into how rules are structured and processed within the system.
Examples
Rate limit request if a cookie is set with a specific value and exceeds a defined limit
If you want to rate limit requests when a specific cookie is set to a certain value and the request rate exceeds a defined limit, you can use the following configuration:
Rate limit request if User-Agent is a known crawler and exceeds a defined limit
If you need to rate limit requests where the User-Agent header contains a known crawler identifier and the request rate exceeds a defined limit, use the following rule configuration: