link from ngnix installed outside docker to a container

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:
(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