403 Error Due to WAF Limitation on Local Worker Execution via Wrangler

For Workes & Pages, what is the name of the domain?

workers.dev

What is the error number?

403

What is the error message?

403 Forbidden

What is the issue or error you’re encountering

When I run my worker locally with Wrangler, I encounter a 403 error when I reach a certain limit. I suspect it’s a WAF issue, but I can’t control the WAF settings for the account*.workers.dev domain. However, when deploying to a custom domain, I can disable the WAF for specific requests to avoid the 403 error.

What are the steps to reproduce the issue?

  1. Run a Worker locally
  2. Call it x times concurrent

You might be getting a 403 from the endpoint which is workers.dev. Might be a rate limit by the endpoint instead of you zone domain rate limit. Therefore, you might want to use a custom domain to control the WAF.

I’m certain the 403-error is from the endpoint workers.dev.
So how can I use a custom domain (WAF) with local development?