Customize Bunny Shield’s protections to throttle abuse, slow malicious bots, and absorb traffic spikes without affecting legitimate users.
Rate limit rules cap how many requests a client can make to your application within a defined window. Combine them with Shield’s targeting controls to throttle abuse on specific endpoints without affecting legitimate traffic.
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.This rule processes each HTTP request by extracting only the REQUEST_URI (Variable), converting it to lowercase, and removing whitespaces (Transformations). It then verifies if the transformed REQUEST_URI matches exactly (Operator) with ‘/blockedpath’ (Operator Value). If a match is found, we increment the global rate limit counter. If the RequestCount (10 requests) is exceeded within the defined 1-second Timeframe, then our WAF Engine will block (Response Action) the request for the defined 30-second BlockTime, halting further rule processing and intercepting the request.With the basics covered, you can write rate limit rules that mitigate the abuse patterns specific to your site.
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:
If you encounter any difficulties or have questions, our support team is here to assist you. Please don’t hesitate to contact us via support request form for prompt assistance.Our dedicated support team is ready to help you resolve any issues you might face during the deployment process, provide additional guidance, or answer your questions.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"bunny.net Documentation","colors":{"primary":"#EF6126","light":"#EF6126","dark":"#EF6126"},"logo":{"light":"https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/logo/bunny-logo-dark.svg?fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=62c091ea1aaea93d0a981902b7783e37","dark":"https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/logo/bunny-logo-light.svg?fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=3610e32d68a9fa458b0116ac58ca812a"},"favicon":"https://mintcdn.com/bunnynet-cb9733c2/1bTPx1eyQm8EK8W3/favicon.png?fit=max\u0026auto=format\u0026n=1bTPx1eyQm8EK8W3\u0026q=85\u0026s=85267b63e804fac7a4dd94599bb8c6e8","navbar":{"links":[{"href":"https://bunny.net/docs/api-reference","label":"API Reference"},{"href":"https://github.com/BunnyWay","label":"GitHub"}],"primary":{"type":"button","label":"Get Started","href":"https://dash.bunny.net/auth/register"}},"footer":{"socials":{"discord":"https://discord.gg/bunnynet","github":"https://github.com/BunnyWay","x":"https://x.com/BunnyCDN","bluesky":"https://bsky.app/profile/bunny.net","linkedin":"https://www.linkedin.com/company/bunnynet","facebook":"https://www.facebook.com/bunnycdn"}},"icons":{"library":"lucide"},"contextual":{"options":["copy","claude","chatgpt","cursor","view","vscode"],"display":"header"},"interaction":{"drilldown":false},"metadata":{"timestamp":true},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"bunnynet-cb9733c2","hasAudioNarration":false,"actualSubdomain":"bunnynet-cb9733c2","customDomains":["bunny.net"],"gitSource":{"type":"github","owner":"bunnyway","repo":"documentation","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae49f2d21d44d6b52dcfe35","collectionId":"5e262b87-ade9-45d8-9b63-06888c8d59a3","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae49f2d21d44d6b52dcfe35"},"feedback":{"thumbs":true,"contextualFeedback":{"allowEmail":true},"agentFeedback":true,"edits":true,"issues":false},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae534f2b9a26f131eb41834","clientVersion":"0.0.4043","searchFilterCounts":[{"language":"default","tag":"Documentation","count":752},{"language":"default","tag":"API Reference","count":318},{"language":"default","tag":"Core Platform API","count":109},{"language":"default","tag":"CDN","count":82},{"language":"default","tag":"Shield API","count":66},{"language":"default","tag":"Stream","count":66},{"language":"default","tag":"Magic Containers API","count":56},{"language":"default","tag":"Storage","count":54},{"language":"default","tag":"Guides","count":54},{"language":"default","tag":"Reference","count":52}],"searchSettings":{"isFiltersEnabled":true}},"assistantConfig":{"enableStarterQuestions":false,"deflection":{"enabled":true,"type":"link","email":"support@bunny.net","url":"https://bunny.net/contact","showHelpButton":true}},"basePath":"/docs","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"privacy":{"consentBanner":{"enabled":true}},"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":".dark img[src*=\"/logo/frameworks/angular.svg\"],.dark img[src*=\"/logo/frameworks/eleventy.svg\"],.dark img[src*=\"/logo/frameworks/express.svg\"],.dark img[src*=\"/logo/frameworks/mariadb.svg\"],.dark img[src*=\"/logo/frameworks/nextjs.svg\"],.dark img[src*=\"/logo/frameworks/sphinx.svg\"]{filter:invert(1)}html:not(.dark) img[src*=\"/logo/frameworks/zola.svg\"]{filter:invert(1)}"}],"page":{"pagePath":"shield/custom-rate-limit-rule","slug":"/shield/custom-rate-limit-rule","pageMetadata":{"title":"Creating a rate limit rule","description":"Customize Bunny Shield’s protections to throttle abuse, slow malicious bots, and absorb traffic spikes without affecting legitimate users.","href":"/shield/custom-rate-limit-rule"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Customize Bunny Shield’s protections to throttle abuse, slow malicious bots, and absorb traffic spikes without affecting legitimate users.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,li:`li`,p:`p`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{Heading,OptimizedImage}=_components;if(!Heading)_missingMdxReference(`Heading`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Rate limit rules cap how many requests a client can make to your application within a defined window. Combine them with Shield’s targeting controls to throttle abuse on specific endpoints without affecting legitimate traffic.`}),`\n`,_jsx(Heading,{level:`2`,id:`what-you’ll-need`,children:`What you’ll need`}),`\n`,_jsx(_components.p,{children:`Before you dive in, make sure you have the following prerequisites in place:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`A `,_jsx(_components.a,{href:`https://bunny.net/`,children:`bunny.net`}),` account (`,_jsx(_components.a,{href:`https://dash.bunny.net/auth/login?pk_buttonlocation=menu`,children:`Log in`}),` or sign up for a `,_jsx(_components.a,{href:`https://dash.bunny.net/auth/register`,children:`free trial`}),`).`]}),`\n`,_jsx(_components.li,{children:`An existing Shield Zone.`}),`\n`,_jsx(_components.li,{children:`Advanced Plan or above on the existing Shield Zone (if creating more than 2 rate limit rules*).`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`creating-a-rate-limit-rule`,children:`Creating a rate limit rule`}),`\n`,_jsxs(_components.p,{children:[`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 `,_jsx(_components.a,{href:`/shield/rule-engine`,children:`Rule Engine`}),` documentation to gain insights into how rules are structured and processed within the system.`]}),`\n`,_jsx(OptimizedImage,{src:`https://mintcdn.com/bunnynet-cb9733c2/GYo51EPI6zuebYhU/images/docs/159a0ca2d03fb26291cd1443372d4806e88716d14bbf377db6bad5984979377e-image.png?fit=max\u0026auto=format\u0026n=GYo51EPI6zuebYhU\u0026q=85\u0026s=8bdd4687ebfec3fca9db9acab6216fd0`,alt:``,\"data-og-width\":`1644`,width:`1644`,\"data-og-height\":`1611`,height:`1611`,\"data-path\":`images/docs/159a0ca2d03fb26291cd1443372d4806e88716d14bbf377db6bad5984979377e-image.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/bunnynet-cb9733c2/GYo51EPI6zuebYhU/images/docs/159a0ca2d03fb26291cd1443372d4806e88716d14bbf377db6bad5984979377e-image.png?w=280\u0026fit=max\u0026auto=format\u0026n=GYo51EPI6zuebYhU\u0026q=85\u0026s=4f72cac24f470e81a79d699c0cb34cec 280w, https://mintcdn.com/bunnynet-cb9733c2/GYo51EPI6zuebYhU/images/docs/159a0ca2d03fb26291cd1443372d4806e88716d14bbf377db6bad5984979377e-image.png?w=560\u0026fit=max\u0026auto=format\u0026n=GYo51EPI6zuebYhU\u0026q=85\u0026s=945c3d6046ab7292ed501fa5cf806cb6 560w, https://mintcdn.com/bunnynet-cb9733c2/GYo51EPI6zuebYhU/images/docs/159a0ca2d03fb26291cd1443372d4806e88716d14bbf377db6bad5984979377e-image.png?w=840\u0026fit=max\u0026auto=format\u0026n=GYo51EPI6zuebYhU\u0026q=85\u0026s=a3011cd5f170cbbf716ba3013da09046 840w, https://mintcdn.com/bunnynet-cb9733c2/GYo51EPI6zuebYhU/images/docs/159a0ca2d03fb26291cd1443372d4806e88716d14bbf377db6bad5984979377e-image.png?w=1100\u0026fit=max\u0026auto=format\u0026n=GYo51EPI6zuebYhU\u0026q=85\u0026s=29010b09a6c9f59a93a49c21b345370e 1100w, https://mintcdn.com/bunnynet-cb9733c2/GYo51EPI6zuebYhU/images/docs/159a0ca2d03fb26291cd1443372d4806e88716d14bbf377db6bad5984979377e-image.png?w=1650\u0026fit=max\u0026auto=format\u0026n=GYo51EPI6zuebYhU\u0026q=85\u0026s=63178f51d3d02cb69dce4ffd7077627a 1650w, https://mintcdn.com/bunnynet-cb9733c2/GYo51EPI6zuebYhU/images/docs/159a0ca2d03fb26291cd1443372d4806e88716d14bbf377db6bad5984979377e-image.png?w=2500\u0026fit=max\u0026auto=format\u0026n=GYo51EPI6zuebYhU\u0026q=85\u0026s=d98c0a8c4248a4d4db6209e02d0c9177 2500w`}),`\n`,_jsxs(_components.p,{children:[`This rule processes each HTTP request by extracting only the REQUEST_URI (`,_jsx(_components.strong,{children:`Variable`}),`), converting it to lowercase, and removing whitespaces (`,_jsx(_components.strong,{children:`Transformations`}),`). It then verifies if the transformed REQUEST_URI matches exactly (`,_jsx(_components.strong,{children:`Operator`}),`) with ‘/blockedpath’ (`,_jsx(_components.strong,{children:`Operator Value`}),`). If a match is found, we increment the global rate limit counter. If the RequestCount (10 requests) is exceeded within the defined 1-second Timeframe, then our WAF Engine will block (`,_jsx(_components.strong,{children:`Response Action`}),`) the request for the defined 30-second BlockTime, halting further rule processing and intercepting the request.`]}),`\n`,_jsx(_components.p,{children:`With the basics covered, you can write rate limit rules that mitigate the abuse patterns specific to your site.`}),`\n`,_jsx(Heading,{level:`2`,id:`examples`,children:`Examples`}),`\n`,_jsx(Heading,{level:`3`,id:`rate-limit-request-if-a-cookie-is-set-with-a-specific-value-and-exceeds-a-defined-limit`,children:`Rate limit request if a cookie is set with a specific value and exceeds a defined limit`}),`\n`,_jsx(_components.p,{children:`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:`}),`\n`,_jsx(OptimizedImage,{src:`https://mintcdn.com/bunnynet-cb9733c2/GYo51EPI6zuebYhU/images/docs/2fcc5381951d8095a887ce2a0479ffcde7c7fd808fa9a9f96994f772e664d8eb-image.png?fit=max\u0026auto=format\u0026n=GYo51EPI6zuebYhU\u0026q=85\u0026s=4203ceafb83504711b88e9fb67b52e5b`,alt:``,\"data-og-width\":`1640`,width:`1640`,\"data-og-height\":`1611`,height:`1611`,\"data-path\":`images/docs/2fcc5381951d8095a887ce2a0479ffcde7c7fd808fa9a9f96994f772e664d8eb-image.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/bunnynet-cb9733c2/GYo51EPI6zuebYhU/images/docs/2fcc5381951d8095a887ce2a0479ffcde7c7fd808fa9a9f96994f772e664d8eb-image.png?w=280\u0026fit=max\u0026auto=format\u0026n=GYo51EPI6zuebYhU\u0026q=85\u0026s=1af89b6d3b9cdf346543b3a9bcc205ac 280w, https://mintcdn.com/bunnynet-cb9733c2/GYo51EPI6zuebYhU/images/docs/2fcc5381951d8095a887ce2a0479ffcde7c7fd808fa9a9f96994f772e664d8eb-image.png?w=560\u0026fit=max\u0026auto=format\u0026n=GYo51EPI6zuebYhU\u0026q=85\u0026s=d16a01a34f954f9e5182cdc5119c89c6 560w, https://mintcdn.com/bunnynet-cb9733c2/GYo51EPI6zuebYhU/images/docs/2fcc5381951d8095a887ce2a0479ffcde7c7fd808fa9a9f96994f772e664d8eb-image.png?w=840\u0026fit=max\u0026auto=format\u0026n=GYo51EPI6zuebYhU\u0026q=85\u0026s=8839eb487129521082df52a288480d7a 840w, https://mintcdn.com/bunnynet-cb9733c2/GYo51EPI6zuebYhU/images/docs/2fcc5381951d8095a887ce2a0479ffcde7c7fd808fa9a9f96994f772e664d8eb-image.png?w=1100\u0026fit=max\u0026auto=format\u0026n=GYo51EPI6zuebYhU\u0026q=85\u0026s=bfa8fb2f0230844ac29910f082d9d243 1100w, https://mintcdn.com/bunnynet-cb9733c2/GYo51EPI6zuebYhU/images/docs/2fcc5381951d8095a887ce2a0479ffcde7c7fd808fa9a9f96994f772e664d8eb-image.png?w=1650\u0026fit=max\u0026auto=format\u0026n=GYo51EPI6zuebYhU\u0026q=85\u0026s=5795dbc17ac25ca872f5be7580420bec 1650w, https://mintcdn.com/bunnynet-cb9733c2/GYo51EPI6zuebYhU/images/docs/2fcc5381951d8095a887ce2a0479ffcde7c7fd808fa9a9f96994f772e664d8eb-image.png?w=2500\u0026fit=max\u0026auto=format\u0026n=GYo51EPI6zuebYhU\u0026q=85\u0026s=1b14de7dad3cd3615b2d8425b47f27ae 2500w`}),`\n`,_jsx(Heading,{level:`3`,id:`rate-limit-request-if-user-agent-is-a-known-crawler-and-exceeds-a-defined-limit`,children:`Rate limit request if User-Agent is a known crawler and exceeds a defined limit`}),`\n`,_jsx(_components.p,{children:`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:`}),`\n`,_jsx(OptimizedImage,{src:`https://mintcdn.com/bunnynet-cb9733c2/GYo51EPI6zuebYhU/images/docs/3c473840055c08fe347e4bbf83ef7771cad56a666b33ef65482abcce35dc41c4-awdawdawdawwdawdawdawdawd.pg.jpg?fit=max\u0026auto=format\u0026n=GYo51EPI6zuebYhU\u0026q=85\u0026s=b69c0ff05fbcc046e2b20c03f8977c86`,alt:``,\"data-og-width\":`1626`,width:`1626`,\"data-og-height\":`1611`,height:`1611`,\"data-path\":`images/docs/3c473840055c08fe347e4bbf83ef7771cad56a666b33ef65482abcce35dc41c4-awdawdawdawwdawdawdawdawd.pg.jpg`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/bunnynet-cb9733c2/GYo51EPI6zuebYhU/images/docs/3c473840055c08fe347e4bbf83ef7771cad56a666b33ef65482abcce35dc41c4-awdawdawdawwdawdawdawdawd.pg.jpg?w=280\u0026fit=max\u0026auto=format\u0026n=GYo51EPI6zuebYhU\u0026q=85\u0026s=0cb992172a79ee6513e1d32a897a0de4 280w, https://mintcdn.com/bunnynet-cb9733c2/GYo51EPI6zuebYhU/images/docs/3c473840055c08fe347e4bbf83ef7771cad56a666b33ef65482abcce35dc41c4-awdawdawdawwdawdawdawdawd.pg.jpg?w=560\u0026fit=max\u0026auto=format\u0026n=GYo51EPI6zuebYhU\u0026q=85\u0026s=38f36ddc3fac836477be535c729804a8 560w, https://mintcdn.com/bunnynet-cb9733c2/GYo51EPI6zuebYhU/images/docs/3c473840055c08fe347e4bbf83ef7771cad56a666b33ef65482abcce35dc41c4-awdawdawdawwdawdawdawdawd.pg.jpg?w=840\u0026fit=max\u0026auto=format\u0026n=GYo51EPI6zuebYhU\u0026q=85\u0026s=44db04f8144bd27df86ec21038ac8ce7 840w, https://mintcdn.com/bunnynet-cb9733c2/GYo51EPI6zuebYhU/images/docs/3c473840055c08fe347e4bbf83ef7771cad56a666b33ef65482abcce35dc41c4-awdawdawdawwdawdawdawdawd.pg.jpg?w=1100\u0026fit=max\u0026auto=format\u0026n=GYo51EPI6zuebYhU\u0026q=85\u0026s=957bbef765ea54b0ae57f94bcb4b0304 1100w, https://mintcdn.com/bunnynet-cb9733c2/GYo51EPI6zuebYhU/images/docs/3c473840055c08fe347e4bbf83ef7771cad56a666b33ef65482abcce35dc41c4-awdawdawdawwdawdawdawdawd.pg.jpg?w=1650\u0026fit=max\u0026auto=format\u0026n=GYo51EPI6zuebYhU\u0026q=85\u0026s=bd7363a90c83069340e08f336eb6cd3d 1650w, https://mintcdn.com/bunnynet-cb9733c2/GYo51EPI6zuebYhU/images/docs/3c473840055c08fe347e4bbf83ef7771cad56a666b33ef65482abcce35dc41c4-awdawdawdawwdawdawdawdawd.pg.jpg?w=2500\u0026fit=max\u0026auto=format\u0026n=GYo51EPI6zuebYhU\u0026q=85\u0026s=40a0201e81ace944cf1c71c67e9a2a98 2500w`}),`\n`,_jsx(Heading,{level:`2`,id:`need-help-or-encountering-issues`,children:`Need help or encountering issues?`}),`\n`,_jsxs(_components.p,{children:[`If you encounter any difficulties or have questions, our support team is here to assist you. Please don’t hesitate to contact us via `,_jsx(_components.a,{href:`https://bunny.net/contact/`,children:`support request form`}),` for prompt assistance.`]}),`\n`,_jsx(_components.p,{children:`Our dedicated support team is ready to help you resolve any issues you might face during the deployment process, provide additional guidance, or answer your questions.`})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Creating a rate limit rule","description":"Customize Bunny Shield’s protections to throttle abuse, slow malicious bots, and absorb traffic spikes without affecting legitimate users.","href":"/shield/custom-rate-limit-rule"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"What you’ll need","slug":"what-you’ll-need","depth":2,"children":[]},{"title":"Creating a rate limit rule","slug":"creating-a-rate-limit-rule","depth":2,"children":[]},{"title":"Examples","slug":"examples","depth":2,"children":[{"title":"Rate limit request if a cookie is set with a specific value and exceeds a defined limit","slug":"rate-limit-request-if-a-cookie-is-set-with-a-specific-value-and-exceeds-a-defined-limit","depth":3,"children":[]},{"title":"Rate limit request if User-Agent is a known crawler and exceeds a defined limit","slug":"rate-limit-request-if-user-agent-is-a-known-crawler-and-exceeds-a-defined-limit","depth":3,"children":[]}]},{"title":"Need help or encountering issues?","slug":"need-help-or-encountering-issues","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"bunnynet-cb9733c2","siteName":"bunny.net Documentation","title":"Creating a rate limit rule - bunny.net Documentation","relatedPagesConfig":{"enabled":false,"limit":5,"mode":"automatic"},"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-30T15:28:19.097Z","gitLastModified":"2026-05-19T11:35:23.000Z","originalFileLocation":"shield/custom-rate-limit-rule.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Customize Bunny Shield’s protections to throttle abuse, slow malicious bots, and absorb traffic spikes without affecting legitimate users.\">\u003cmeta data-mint-head name=\"application-name\" content=\"bunny.net Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Creating a rate limit rule - bunny.net Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Customize Bunny Shield’s protections to throttle abuse, slow malicious bots, and absorb traffic spikes without affecting legitimate users.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"bunny.net Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://bunny.net/docs/shield/custom-rate-limit-rule\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://bunnynet-cb9733c2.mintlify.app/_mintlify/api/og/v2?division=Rate+Limiting\u0026amp;title=Creating+a+rate+limit+rule\u0026amp;description=Customize+Bunny+Shield%E2%80%99s+protections+to+throttle+abuse%2C+slow+malicious+bots%2C+and+absorb+traffic+spikes+without+affecting+legitimate+users.\u0026amp;theme=3e3fa11ba94222b95e7f52d5\u0026amp;signature=e35670f2fe8440c5957675934146daab2c574892c98eb18a16b7daaecf9bc6e6\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Creating a rate limit rule - bunny.net Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Customize Bunny Shield’s protections to throttle abuse, slow malicious bots, and absorb traffic spikes without affecting legitimate users.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://bunnynet-cb9733c2.mintlify.app/_mintlify/api/og/v2?division=Rate+Limiting\u0026amp;title=Creating+a+rate+limit+rule\u0026amp;description=Customize+Bunny+Shield%E2%80%99s+protections+to+throttle+abuse%2C+slow+malicious+bots%2C+and+absorb+traffic+spikes+without+affecting+legitimate+users.\u0026amp;theme=3e3fa11ba94222b95e7f52d5\u0026amp;signature=e35670f2fe8440c5957675934146daab2c574892c98eb18a16b7daaecf9bc6e6\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/bunnynet-cb9733c2/Zv4NOenQlgPS3TXm/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"bunny.net Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#EF6126\">\u003clink data-mint-head rel=\"canonical\" href=\"https://bunny.net/docs/shield/custom-rate-limit-rule\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/shield/custom-rate-limit-rule.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://bunny.net/#organization\",\"name\":\"bunny.net Documentation\",\"url\":\"https://bunny.net\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/bunnynet-cb9733c2/54-4KCQKoNVNuoyW/logo/bunny-logo-dark.svg?fit=max\u0026auto=format\u0026n=54-4KCQKoNVNuoyW\u0026q=85\u0026s=62c091ea1aaea93d0a981902b7783e37\"}},{\"@type\":\"WebSite\",\"@id\":\"https://bunny.net/docs#website\",\"name\":\"bunny.net Documentation\",\"url\":\"https://bunny.net/docs\",\"publisher\":{\"@id\":\"https://bunny.net/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://bunny.net/docs/shield/custom-rate-limit-rule#webpage\",\"url\":\"https://bunny.net/docs/shield/custom-rate-limit-rule\",\"name\":\"Creating a rate limit rule\",\"description\":\"Customize Bunny Shield’s protections to throttle abuse, slow malicious bots, and absorb traffic spikes without affecting legitimate users.\",\"dateModified\":\"2026-05-19T11:35:23.000Z\",\"isPartOf\":{\"@id\":\"https://bunny.net/docs#website\"},\"breadcrumb\":{\"@id\":\"https://bunny.net/docs/shield/custom-rate-limit-rule#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://bunny.net/docs/shield/custom-rate-limit-rule#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Protection Features\",\"item\":\"https://bunny.net/docs/shield/waf\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Rate Limiting\",\"item\":\"https://bunny.net/docs/shield/rate-limiting\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Creating a rate limit rule\",\"item\":\"https://bunny.net/docs/shield/custom-rate-limit-rule\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://bunny.net/docs/shield/custom-rate-limit-rule#article\",\"headline\":\"Creating a rate limit rule\",\"name\":\"Creating a rate limit rule\",\"description\":\"Customize Bunny Shield’s protections to throttle abuse, slow malicious bots, and absorb traffic spikes without affecting legitimate users.\",\"url\":\"https://bunny.net/docs/shield/custom-rate-limit-rule\",\"mainEntityOfPage\":{\"@id\":\"https://bunny.net/docs/shield/custom-rate-limit-rule#webpage\"},\"dateModified\":\"2026-05-19T11:35:23.000Z\",\"publisher\":{\"@id\":\"https://bunny.net/#organization\"},\"isPartOf\":{\"@id\":\"https://bunny.net/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"bunny.net Documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"bunny.net Documentation","nav":{"global":null,"products":[{"product":"Home","icon":"book-open","pages":[{"title":"Home","href":""}]},{"product":"CDN","icon":"zap","description":"Accelerate and protect your content globally","pages":[{"title":"CDN","href":"/cdn"}]},{"product":"Magic Containers","icon":"box","description":"Deploy any app anywhere with Docker","pages":[{"title":"Magic Containers","href":"/magic-containers"}]},{"product":"Edge Scripting","icon":"code","description":"Deploy serverless code at the edge","pages":[{"title":"Edge Scripting","href":"/scripting"}]},{"product":"Stream","icon":"video","description":"Video streaming and delivery platform","pages":[{"title":"Stream","href":"/stream"}]},{"product":"Storage","icon":"hard-drive","description":"Global object storage","pages":[{"title":"Storage","href":"/storage"}]},{"product":"Shield","icon":"shield","description":"Stay protected and online no matter what","tabs":[{"tab":"Documentation","groups":[{"group":"Documentation","pages":[{"title":"Bunny Shield","sidebarTitle":"Introduction","mode":"wide","href":"/shield"},{"title":"Quickstart","href":"/shield/quickstart"},{"title":"Pricing","href":"/shield/pricing"},{"title":"Bunny Shield Changelog","sidebarTitle":"Changelog","url":"/changelog?tags=Shield","href":"/shield/changelog"}]},{"group":"Protection Features","pages":[{"group":"WAF","pages":[{"title":"WAF","sidebarTitle":"Overview","href":"/shield/waf"},{"title":"Understanding Rule Engine","href":"/shield/rule-engine"},{"title":"Creating a custom WAF rule","href":"/shield/custom-waf-rule"}]},{"group":"Rate Limiting","pages":[{"title":"Rate Limiting","sidebarTitle":"Overview","description":"Bunny Shield's rate limiting is a critical feature of its Web Application Firewall (WAF) that helps prevent abuse of your web resources by controlling the number of requests a client can make to your application within a given timeframe. This feature is essential in mitigating brute force attacks, Distributed Denial-of-Service (DDoS) attacks, and other types of automated abuse. In this section, we’ll guide you through configuring rate limiting rules to protect your application effectively without impacting legitimate users.","href":"/shield/rate-limiting"},{"title":"Creating a rate limit rule","href":"/shield/custom-rate-limit-rule"}]},{"title":"DDoS Mitigation","description":"Protect your web applications against DDoS attacks and understand mitigation metrics and sensitivity settings.","href":"/shield/ddos"},{"title":"Bot Detection","href":"/shield/bot-detection"},{"title":"Access Lists","href":"/shield/access-lists"},{"title":"Upload Scanning","href":"/shield/upload-scanning"},{"title":"API Guardian","href":"/shield/api-guardian"}]},{"group":"Reference","pages":[{"title":"Custom Response Pages","href":"/shield/custom-response-pages"},{"title":"Verified Bots","href":"/shield/verified-bots"},{"title":"Metrics \u0026 Logging","href":"/shield/metrics"},{"title":"Cookies","href":"/shield/cookies"},{"title":"Troubleshooting","href":"/shield/troubleshooting"},{"title":"API Reference","url":"/api-reference/shield","href":"/shield/api-reference"}]}]}]},{"product":"Optimizer","icon":"sparkles","description":"Automatic image and web optimization.","pages":[{"title":"Optimizer","href":"/optimizer"}]},{"product":"DNS","icon":"globe","description":"Unlock the true power of DNS with an ultra-fast scriptable platform","pages":[{"title":"DNS","href":"/dns"}]},{"product":"Database","icon":"database","description":"Serverless SQLite over HTTP","pages":[{"title":"Database","href":"/database"}]},{"product":"Integrations","icon":"puzzle","description":"Official and third-party plugins and integrations","pages":[{"title":"Integrations","href":"/integrations/wordpress"}]},{"product":"CLI","icon":"terminal","description":"Manage bunny.net from your terminal","pages":[{"title":"CLI","href":"/cli"}]},{"product":"API Reference","icon":"square-terminal","description":"Build \u0026 Integrate with the Platform API","pages":[{"title":"API Reference","href":"/api-reference"}]},{"product":"Partners","icon":"handshake","description":"Manage customers, pricing, and billing as a bunny.net partner","pages":[{"title":"Partners","href":"/partners"}]}]},"basePath":"","title":"Creating a rate limit rule - bunny.net Documentation","buildId":"dpl_4RHMRqtvdHvKgaEfTTjFqjzja3B6","deploymentId":"dpl_4RHMRqtvdHvKgaEfTTjFqjzja3B6","dynamics":["a74be98ba7"],"chunks":["zoom-image-lightbox-CZTaVDTN.js","lightbox-handle-r17bVUz3.js"]}