IP addresses are different when using different worker custom domains

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

umami.is and umami.dev

What is the error number?

No specific behavior but we are seeing strange behavior with workers

What is the issue or error you’re encountering

I have two domains under on Cloudflare account. I created a worker and assigned two custom domains pointing to the same worker. But, the data differs depending on which domain is used.

What steps have you taken to resolve the issue?

I am measuring unique cf-connecting-ip header values to determine unique visitors. When requests are sent through umami.dev, we see a normal amount of visitors. However, if requests are sent through umami.is, the number of unique IP values drop dramatically, down to 1/10th the normal value. Since both domains point to the exact same worker, I don’t see how they can differ.

I have tried:

  • Adding/removing different custom domains
  • Using worker routes
  • Logging the IP addresses

But it seems anything going through the .is domain is having this issue.

After much debugging, I think I found the issue. Requests to the worker from the .is domain gets its cf-connecting-ip header rewritten to the IP address 2a06:98c0:3600::103, which is Cloudflare’s IP assigned to workers. But for whatever reason, this doesn’t happen for requests from the .dev domain. I had to add additional logic to the worker to work around this.

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