How to log real remote IP in my aws elb which proxied by Cloudflare

I connected AWS ELB in Cloudflare Proxy mode.
I configured access logs in AWS ELB, which retains Remote IP and X-Forwarded-For.

But as everybody knows, CF_CONNECTING_IP should be present in the AccessLog for it to be meaningful.

However, modifying CF_CONNECTING_IP or X-Forwarded-For headers is not possible from Cloudflare.
And as I know, it is also not possible to log CF_CONNECTING_IP in AWS ELB.

I want the actual user’s REMOTE_IP to be logged in the ELB Access Log.

I understand that not being able to modify X-Forwarded-For is a security issue.

However, I’m curious if there is a configuration in Cloudflare to add REMOTE_IP into X-Forwarded-For or
if there’s any way to log CF_CONNECTING_IP in AWS ELB.

Please let me know if you have any insights.

TrueClientIP doesn’t seem to be the method I want…

Haven’t used AWS, however may I ask if you’re somehow able to modify or format the way of how does the server log the requests? :thinking:

Possibly with implementing and sending it into the header, therefrom at the server reading it :thinking:

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