Frequent nginx rate limiting with nginx also on the host

You need to tell nginx inside the container to trust 172.17.0.1 to set the Client IP headers by using the set_real_ip_from directive.