Getting error 1003 while using workers for load balancing

For Workers & Pages, what is the name of the domain?

fuel-mainnet.rubynodes.io

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?

  1. I tried setting various IPs for my subdomain
  2. 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)
  });
  1. I tried to disable WAF and firewall to see if it helps (it didn’t)

What are the steps to reproduce the issue?

  1. 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
  2. I have a DNS record for the subdomain set with Cloudflare Proxy allowed
  3. Servers are being accessed by their IP and port like http://1.2.3.4:123
  4. 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)
  5. The worker is connected to my subdomain (https://fuel-mainnet.rubynodes.io), otherwise I wouldn’t see the error
  6. 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

Screenshot of the error

This happens when you directly accesses a Cloudflare IP address

as explained here, you’d need to browse to the website domain name in your URL instead of the Cloudflare IP address.

Hello, I am unsure if this solution applies to my problem, as I use my domain address (fuel-mainnet.rubynodes.io) to access the application.
The communication goes as fuel-mainnet.rubynodes.io → my worker → IP address. 1003 is generated when the worker is trying to forward the request to the IP address of my backend server.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.