Assign public domains to each container using single public IP on host server

Since when we enable the bridge network (lxdbr0), it comes up with the private networking configured to communicate with the host node and all containers, how can I make it possible that the host server’s public IP allows access to create public domains like container-a.com, container-b.com and route to their respective containers?

For now, I am using a proxy container, which is assigned to use port 80 and 443 and it uses nginx to further achieve this configuration. Any other ways? I don’t want to use proxy container in every host server I got to achieve this.

You have a server with a single public IP address. When a user connects to your server, your server does not see which hostname was used by the client, on the TCP/IP layer.
Which means, that your server is not able to differentiate between whichever hostnames were used by the clients.

However, with the HTTP protocol, the client passes the intended hostname to the server, hence your Web server (or reverse proxy server, if you have multiple Web servers) is able to figure out the proper hostname. If you look into the HTTP fields (you can do this on your browser by opening the Developer Tools, or pressing F12), you will notice the Host: field that has the hostname of the intended website.

If you do not want to use a reverse proxy, then you would need to setup different port numbers for each Web server. But that is not a common practice and will spook some users.

Got it, thanks @simos but this way proxy container will become a bottleneck for performance. Is there a way to use different ports and map a domain to each? For example,

10.140.10.7:3000 --> points to domain-a.com
10.140.10.7:4001–> points to domain-b.com
10.140.10.7:7009 --> points to domain-c.com

The difficulty is in the case of the reverse mapping.
Suppose your public IP address is 93.184.216.34. How would you distinguish a network connection destined to a specific domain, if the only information is that there has been a TCP connection to the IP address 93.184.216.34? When a TCP connection is established, your server’s TCP stack does not get to see which domain/hostname was used for that connection.