How to change the default config in cowboy

Well, I know the cowboy is the web server. If i don’t want my website showing is localhost:4000, I have a domain,want to host to my phoenix website, Then how to change the cowboy config to host this domain.
or add a new vhosts in it.

Well, there are 2 major approaches to this problem:

  1. Do use only phoenix and configure the endpoint to listen on port 80.
  2. Use phoenix and a reverse-proxy. Configure phoenix to use whatever port is available and configure your usual webserver to reverse-proxy requests when necessary.

Method 2 is definitively prefered when you run multiple sites on a single server, also it might be easier to handle the apps permissions when it does not use a port <= 1023. Also there are many other tricks possible by using a reverse-proxy. So in fact I do think method 1 is a quick and dirty solution for short-time things eg. ranking on a esport like event.