This file records practical pitfalls found during Cloud Gateway development and rollout.
Symptom:
- App-side weather calls fail, while other internet features look normal.
Observed cause:
- Some networks can resolve
workers.devbut fail on transport path to the resolved IP.
Recommendation:
- Prefer a custom domain bound to the Worker (for example
gateway.example.com) for production.
Quick checks:
Test-NetConnection <gateway-domain> -Port 443curl -I https://<gateway-domain>/api
Symptom:
- Requests are blocked before entering Worker business logic.
Cause:
- Cloudflare Access is enabled, but the app only sends
X-API-Key.
Recommendation:
- For current architecture, keep Access disabled.
- If Access must be enabled, add service token headers in client requests:
CF-Access-Client-IdCF-Access-Client-Secret
Symptom:
- Domain appears added in Cloudflare, but Worker custom domain does not activate.
Cause:
- NS records were edited in DNS-record view, not registrar-level nameserver settings.
Correct action:
- Update registrar nameservers to Cloudflare-assigned nameservers.
- Wait until zone status is
Active.
What to expect after adding custom domain to Worker:
- DNS page shows a
Worker-type record for your subdomain. - Proxy status should be enabled.
Current expected request payload:
{
"service": "weather",
"endpoint": "weather",
"method": "GET",
"params": {
"q": "london",
"units": "metric"
}
}Headers:
X-API-Key: <APP_GATEWAY_API_KEY>Content-Type: application/json
Local relay via 10.0.2.2 can help isolate emulator networking issues, but it should not be the final production path.
Production path:
- App -> custom HTTPS gateway domain -> Worker -> upstream API
A previous normalization step replaced : and broke URLs like https://....
Rule of thumb:
- Never normalize away URL scheme delimiters in command parsing.
- Gateway custom domain is
Active. - Access policy is intentionally configured (disabled for current app flow).
- Host smoke test returns 200 for weather request.
- App weather command returns 200 and readable output.
local.propertiesis local-only and not committed.