What is the name of the domain?
example[dot]com (real domain masked)
What is the error message?
PageSpeed Insights test fails with “Lighthouse returned error: ERRORED_DOCUMENT_REQUEST” while Under Attack Mode is enabled, even though a user agent allowlist rule for Chrome-Lighthouse is active.
What is the issue you’re encountering
I’m using “Under Attack Mode” to mitigate DDoS traffic, but PageSpeed Insights requests are still being blocked even though I have an active WAF custom rule that allowlists Google-related User Agents (e.g., Chrome-Lighthouse, Google PageSpeed Insights, AdsBot-Google, Googlebot). The rule is confirmed to be active and matching in Cloudflare logs, but the PageSpeed test fails with a connection error.
What steps have you taken to resolve the issue?
I created and activated a custom WAF rule to skip security checks for known Google User Agents (including Chrome-Lighthouse and Googlebot). I also tested the rule in Cloudflare and verified that it matches the requests correctly. Additionally, I deactivated and reactivated the rule and ran multiple PageSpeed tests. I also tested it with and without “Under Attack Mode” to compare the results.
Was the site working with SSL prior to adding it to Cloudflare?
Yes
What is the current SSL/TLS setting?
Full (strict)
What are the steps to reproduce the issue?
- Enable “Under Attack Mode” in Cloudflare for the domain.
- Ensure the WAF rule to skip known Google User Agents (e.g., Chrome-Lighthouse, Google PageSpeed Insights) is active.
- Go to https://pagespeed.web.dev/ and test the domain.
- The PageSpeed test fails with a 403 error or “Lighthouse returned error: ERRORED_DOCUMENT_REQUEST”, even though the request appears in the Cloudflare logs as “skipped”.