I’m trying to restore the request original ip address from the following headers:
[‘X-Forwarded-For’] and [‘CF-Connecting-IP’], however, the IP address I get points to Cloudflare’s nearby data center.
Does this need to be configured manually from somewhere or does it works oob?
it’s a subdomain call, something like api.mydomaincom/aa/aaa which is being handled by nginx docker container which routes the request to another docker container.
I don’t know, how but after a couple try I no longer get Cloudflare’s IP, instead when I lookup the new IP it belongs to Akamai International BV
I have another domain that is also being handled by Cloudflare and requests get routed to the exact same machine. In this case, nginx can see the correct IP.
update:
registered a subdomain for the second domain, and the IP is not being preserved again.
calling without subdomain everything is fine
If that’s the case, I would look at the configuration again, especially the specific place in your configuration, where you added that option to restore IP addresses.
A lot of things can be configured both so they are only effective for one individual domain, but also so they are effective “globally” (e.g. for all hosted domains).
I think I know what is causing the issue.
It seems configs are correct. I am using Firefox and Safari with custom privacy configs and it looks they both route traffic through their own proxies.
I’m also using Postman for API call testing and the same issue with Postman.
When I use Google Chrome, everything is just fine.
I apologize for too many posts, can’t find how to edit my post to post an update.
while google chrome is ok, I can still see my original IP with Firefox and Safari when visiting IP lookup websites.
So they can somehow see the original IP even with multiple proxies in front.