Worker CF Location Data Detects Proxy IP ... not real Visitor IP

I am currently trying to figure out how I can pass / forward a visitors IP-address to my Worker.

When I go directly to my Worker, the client-ip and the request.cf location data are accurate.

But, our current infrastructure has a different server / proxy in front of the Worker. As a result, the Worker is capturing the IP of the proxy and generating request.cf location data from our proxy server IP address, not the true client’s ip.

Is it possible to get my Worker to process request.cf data from my true client? … possibly through using header information from the other proxy before going to the Worker?

No the cf information is generated when the request hits Cloudflare.

You can have the proxy server add a header with the true client’s IP and have your worker get that header from each request.

1 Like

Theoretically, the X-Forwarded-For header should keep that original True Client address if Our other proxy server sets it.

1 Like

Thank you, I have been able to pass the true-client-ip through from client → proxy → worker, but my overall goal is to get the cf.location data to match the true client ip, not my proxy which is located in front of the worker.

Does anyone know if this is a requested feature?

@sdayman this reply is also for you