When running an API behind Cloudflare, especially with Bot Fight Mode enabled, a common concern is whether legitimate mobile app traffic might get blocked.
After testing a real-world setup with a mobile app and API endpoint, here are the key findings and practical solutions.
Modern mobile apps (iOS and Android) typically use native networking stacks:
iOS β CFNetwork (URLSession)
Android β OkHttp
These clients:
use real TLS fingerprints
behave like real devices
send consistent, structured requests
Mobile app requests:
consistently returned 200 or 304
were not challenged
were not blocked
π In practice, Bot Fight Mode handled mobile traffic well.
Bot Fight Mode is:
behavior-based and probabilistic β not deterministic
That means:
It works well under normal usage
But behavior can change over time
High-frequency or burst requests
Unusual query patterns
Changes in Cloudflare detection models
Traffic from less trusted networks
π So while it appears safe, there is still long-term risk of false positives.
You are balancing two things:
| Goal | Approach |
|---|---|
| Maximum protection | Keep Cloudflare proxy + Bot Fight Mode |
| Maximum reliability | Bypass Cloudflare filtering |
To fully eliminate Bot Fight Mode interference, you can:
π Switch the API subdomain to DNS-only (no proxy)
This changes the flow:
Client β Server (direct)
Instead of:
Client β Cloudflare β Server
When using DNS-only:
Cloudflare is no longer handling HTTPS
Your server must present a publicly trusted certificate
π Cloudflare Origin Certificates will NOT work
They are only valid when proxy is enabled.
Use a standard public certificate such as Letβs Encrypt:
trusted by browsers and mobile clients
works with direct connections
supports automation
When issuing certificates, a common issue is:
HTTP validation fails when traffic is proxied
Instead of switching proxy on/off (which can cause downtime), use:
π DNS-01 challenge
This method:
validates ownership via DNS
does not depend on web server access
works with proxy ON or OFF
avoids any traffic disruption
After setup:
API subdomain β DNS-only
TLS β Letβs Encrypt certificate
Mobile apps β connect directly
Bot Fight Mode β no longer in path
Bot Fight Mode generally works well with mobile apps
However, it is not guaranteed to remain stable
For critical API reliability, direct access is safer
π The most robust approach:
Use DNS-only for API
Use Letβs Encrypt for TLS
Use DNS-01 for zero-downtime certificate management
Bot protection systems are designed to strike a balance between security and usability.
In testing:
Mobile traffic behaved correctly
No immediate issues were observed
But because detection is adaptive:
Itβs safe enough for now β but not something to rely on blindly.