Firstly you need to configure HAProxy to pass the client IP address, which is quite simply done by adding the "forwardfor" and "http-server-close" options to the backend, ensuring that the real client IP reaches the backend web servers via the X-Forwarded-For header. Here is the configuration I'm using for my…