Posts Tagged HTTPS
Capturing users IP addresses in Apache httpd and Tomcat logs behind an ELB
Posted by Jon Zobrist in Apache, AWS, ELB, Linux Support - Servers on January 6, 2012
When an Elastic Load Balancer handles a connection it sends it’s own (internal/private/10.x) address instead of the clients. It sends the clients along with the request as X-Forwarded-For. To log this you need to log X-Forwarded-For instead of the source IP.
Here are 2 links discussing the problem, the first covers a basic Apache & Tomcat setup, but the second one has a point about direct access getting not logged and has an Apache httpd specific solution.
http://blog.kenweiner.com/2009/09/amazon-elb-capturing-client-ip-address.html
http://blog.grahampoulter.com/2011/10/how-to-log-client-ip-from-apache-behind.html
Thanks @grahampoulter and @kweiner