For Workers & Pages, what is the name of the domain?
What is the error number?
1003
What is the error message?
Direct IP access not allowed
What is the issue or error you’re encountering
I am using workers to automated geo load-balancing between RPC servers running on bare metals behind my domain. The scripts seems to work fine (all the conditions are working within it are working) but it seems that using IP of our servers in the call is causing the problems
What steps have you taken to resolve the issue?
- I tried setting various IPs for my subdomain
- I debugged my worker and the problematic part of the code is
const newUrl = `http://${backendIP}:${port}${url.pathname}${url.search}`;
// for instance http://1.2.3.4:123/status
// Forward the request to the new server
const response = await fetch(newUrl, {
method: request.method, // Use the same HTTP method
headers: request.headers, // Forward the original headers
body: request.body // Forward the original body (if any)
});
- I tried to disable WAF and firewall to see if it helps (it didn’t)
What are the steps to reproduce the issue?
- I set up my worker to get region from the request headers and according to that redirect the request to either our US or EU server
- I have a DNS record for the subdomain set with Cloudflare Proxy allowed
- Servers are being accessed by their IP and port like
http://1.2.3.4:123
- I have set Flexible TLS/SSL within a Page rule for our subdomain as our servers are not running on SSL internally (which is fine, the application is a simple RPC server working with public data only)
- The worker is connected to my subdomain (https://fuel-mainnet.rubynodes.io), otherwise I wouldn’t see the error
- I tried DNS record pointing either to dummy IP address or both records with the same subdomain each pointing to one of my backend servers