Nginx – Customize log entry for AWS ELB for real user IP

amazon-elbcloudflareloggingnginx

I would like to change the logging format for AWS ELB, in order to log the real user IP.

My current server setup contains multiple layers of proxies as followed:

CloudFlare -> AWS ELB -> Nginx (EC2)

With proper nginx modules, I am able to obtain the real client IP in the log of my EC2 instance using the X-Forwarded-For header. However, I am not able to find a way to configure AWS ELB to log the IP in X-Forwarded-For which is set by CloudFlare.

I would like to customize the log entry generated by AWS ELB to log the real user IP, so I can analyze the full log in the future, rather than collect the logs from each EC2 instance.

Is there a way to do that?

Best Answer

I wrote emails to AWS technical support and they responded that currently ELB does not support such configuration at this point.

Related Topic