'Route all port 80 traffic without adding them to the /etc/hosts file

I am running containers using Docker in Mac. I have to run many containers as per the project requirements.

Some projects have the dependency to use the domain name based routing.

So, I have to add the domain name in /etc/hosts file and forward the particular routes to the container port using Reverse proxy.

Is there any possibility to listen at PORT 80 only for the specified particular domains and then route the traffic to the proxy container.

Note: I dont want to add domains in the /etc/hosts file.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source