link from ngnix installed outside docker to a container

friends,
I have a ubuntu server with ngnix installed outside of docker.

I have a docker image that has a web application, with an ip for example: 172.17.0.3
(all within the same server)

How can I do it from my nginx to the ip of the name container? for example: “ip container docker”

That structure cannot change, that’s how aws service creates it.
* obs: the Ip can change because of that I need as a dynamic variable.

upstream openerp {
server "ip container docker":8069;}

use: $host or hotname, not work

Source: StackOverflow