No. You don't know how it works then, iptables does not communicate with nginx to show the real IP. Run tcpdump to confirm this your self. not directly but if you use fail2ban then it's reading ip from nginx logs which when real ip is configured...