All IPv6 IP addresses show up as 172.17.0.1

I had a site complain that a bunch of users were getting 429 errors. It turned out that they were having their IP addresses listed as 172.17.0.1. Most users had their actual address in the logs. I finally figured out that this site has IPv6 enabled and has an AAAA record configured and think this is the issue.

I created /etc/docker/daemon.json:

{
  "userland-proxy": false
}

and restarted docker and the problem went away.

This seems like a bug. Isn’t there some way that the nginx template could solve this?