Docker bridge and nginx allowed ip

This is expected and is the way docker networking works. By default you end up with something a bit like a virtual network on your docker host. Connections forwarded through from the outside will come to each container via docker0 and NAT.

To overcome that, the simple answer is to use host networking on the nginx container. i.e. --network host option to docker run command. See: host networking

Also, read through the docker networking documentation. It's explained more thoroughly there. https://docs.docker.com/network/