How to connect multi containers in one server with multi docker compose

I use docker compose created 4 containers,each of them have their own docker-compose.yml file,

These containers also joined the same network.

How to write the Nginx conf to reverse proxy to other container?

"Containers": {
    "04c62c61d3d31325d3f4be8ad57a64903be5949c242cc1e5d4f58ec038af0cb5": {
        "Name": "nginx-proxy",
        "EndpointID": "c3b6974a94942c3f655b1605415e8ff8dcc645cba5167d68df95886690c82458",
        "MacAddress": "02:42:ac:13:00:03",
        "IPv4Address": "172.19.0.3/16",
        "IPv6Address": ""
    },
    "64f5db50594cf4147c8707600d1e200a6d0d89ff156f58aa4be9aff58c6a6d65": {
        "Name": "wordpress_1",
        "EndpointID": "aa0d53042e7d8e15f4d03f4f6e4ad221c1853a8b5fa50777c16c495b5323bace",
        "MacAddress": "02:42:ac:13:00:05",
        "IPv4Address": "172.19.0.5/16",
        "IPv6Address": ""
    },
    "664c3da9fdb9d6a35a19037d747d0a95fcde860449f5ec774f0983cb9947488e": {
        "Name": "db_1",
        "EndpointID": "7147c40cdd321a2fc3a47803ff43a9269dfd7deaeb3f401562578a5320df16d6",
        "MacAddress": "02:42:ac:13:00:04",
        "IPv4Address": "172.19.0.4/16",
        "IPv6Address": ""
    },
    "bedadf5c1a10d823097a6cf82d9603110ebda7e75f80ec18d5ad912aa62489ed": {
        "Name": "phpmyadmin",
        "EndpointID": "715b107fd4058cee181ef9de83bdb0fe1faf4dbf8b1e62dffb9d1cd0f3eb10e5",
        "MacAddress": "02:42:ac:13:00:02",
        "IPv4Address": "172.19.0.2/16",
        "IPv6Address": ""
    }
},