Apache Logs Show the Load Balancer's IP, Not the Client's: Fixing It Behind HAProxy

You put HAProxy in front of two Apache servers, everything balances nicely, and then you open the access log on one of the web servers. Every single request comes from the same IP: the load balancer. This guide explains why that happens, the quick fix (log the X-Forwarded-For header), and the cleaner fix with mod_remoteip, plus the detail most guides skip: the quick fix can be faked by any client. ...

December 6, 2026 · 5 min · Sysadmin Field Notes