admin管理员组

文章数量:1277317

I am using workers to automate geo load balancing between RPC servers running on bare metals behind my domain. I need to load balance between different ports so workers look like to be more flexible option than native load balancing on Cloudflare. The worker code seems to work fine except for the last part which is a forwarding call to one of our bare metal servers by its IP address.

This is what I've done

  1. I set up my worker to get the 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 (fuel-mainnet.rubynodes.io) set with Cloudflare Proxy allowed
  3. Servers are being accessed by their IP and port like :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 (), otherwise I guess I wouldn’t see the error page
  6. I tried to set the DNS record for fuel-mainnet.rubynodes.io pointing either to dummy IP address or with multiple records for the same domain pointing to our backend servers

This is the problematic part of the worker`s code

const newUrl = `http://${backendIP}:${port}${url.pathname}${url.search}`;
  // for instance :123/status
  const response = await fetch(newUrl, {
    method: request.method,
    headers: request.headers,
    body: request.body
  });
// here it fails with 1003
return response;

After this call, I am getting 1003 error which you can verify by either going to or by curl .

I tried disabling WAF and tweak other security settings but that didn't solve the issue unfortunately. So the question is how to work with external servers (to Cloudflare) by their IP addresses so I don't have to run any proxy like nginx in front of them.

本文标签: cloudflareGetting 1003 error while using Clouflare Workers for load balancingStack Overflow