I run a small webserver using Nginx (at them moment) at home, where I have a fixed IP address. I know Nginx and Apache can be configured to run two different websites, with different domain names, on the same IP address, but can the same be done with Phoenix / Cowboy? It would have to be a solution that is robust to channels being used. How do I go about doing this?
Yes this thing could be done using phoenix and cowboy.
We can configure the plug to send requests to difference endpoints (one domain per endpoint). It will functions like apache or nginx reverse proxy different domains to difference web apps.
I think I have saw this one working project like this before, I will try to find a it’s source and put here as the example. (that project is setup inside umbrella app. It’s has 3 apps inside -
Plug and Cowboy
Phoenix app
another Phoenix app). It works like this when a requests come in the first app (plug and cowboy) will see read the request domain and then will forward to one of the other phoenix apps upon the domain addresss.