Assistance Required: Cloudflare IPV6 over IPV4 Issue Affecting API Geolocation Accuracy

Hi everyone, I hope this message finds you well. We are currently utilizing Cloudflare’s orange cloud to proxy requests to our API, which is deployed on Tomcat and utilizes NGINX. Our API provides an IP-to-geolocation service to customers, and while the orange cloud proxy is enabled, we’ve encountered an issue where it sends IPV6 addresses to our server instead of IPV4. I’ve tested this personally, and though I have both IPV4 and IPV6 available, the system consistently sends IPV6. When the orange cloud is disabled, everything functions as expected, and IPV4 addresses are passed correctly. However, disabling the orange cloud isn’t an option due to security concerns. The reason IPV4 is essential for us is that while we offer 100% country-level accuracy and 90% city-level accuracy for IPV4 geolocation, the same level of accuracy is not yet available for IPV6. Our IPV6 geolocation capabilities are still under development, and customers have started to raise complaints about inaccuracies. We’re unable to disable IPV6 compatibility altogether, as this would prevent users without IPV4 access from reaching our API. I’m reaching out to see if anyone has encountered a similar issue and whether there’s a way to enforce Cloudflare to prioritize or send IPV4 instead of IPV6 while keeping the orange cloud enabled. Any suggestions or guidance would be greatly appreciated. Thank you in advance for your help.
1 Reply
knight
knightOP3mo ago
The issue arises specifically when Cloudflare’s Orange Cloud (proxy) feature is enabled. I have configured NGINX to prioritize IPv4 connections over IPv6. However, with Orange Cloud activated and requests being proxied through Cloudflare, the server consistently returns IPv6 addresses, which is causing significant problems for our system. With Orange cloud disabled I'm getting this response: {"ip":"136.243.82.59"} While with CF's orange cloud enable, I'm getting this for same request from same server: {"ip":"2a01:4f8:212:3005::2"}
Want results from more Discord servers?
Add your server