You need NGNIX or Apache HTTP server as a proxy server for forwarding http requests to appropriate application -> which listens particular port (or do it with CNAME which provides Hosting company). It is most powerful solution and this is just a really easy way to keep adding new subdomains, or to add new domains automatically when DNS records are pointed at the server.
Apache era call it Virtual host -> httpd.apache.org/docs/trunk/vhosts/examples.html
NGINX -> Server Block https://www.nginx.com/resources/wiki/start/topics/examples/server_blocks/