Getting Real IP For nginx & Blocking IP on HAProxy
At Tech in Asia, HAProxy load-balances requests across two nginx web servers, but since every request arrives from the balancer, nginx logs only its IP. HAProxy's forwardfor option forwards the original client IP, which nginx can then read and block.