Hi everyone, I have a Linux server where I expect to host many Go WebApps.By now it’s running one and everything is fine. But now, I noticed that I will not be able to run others WebApps because the port 80 will be busy with the first website, how can I handle it? that’s one thing.
The other is, how can I handle multiple URL’s in the same server. How to redirect to certain webapp depending of the URL requested? is it possible? I was thinking in a reverse proxy as Nginx but then I have the problem with the port 80.
Thank you very much!
So as the other poster said, use a reverse proxy (definitely try caddy first, I’ve used it and can recommend). This will serve on port 80/443, and then proxy requests on that port through to your backends on ports like 4000-5000 say, of which you can have as many as the server can handle. By default caddy will serve on port 443 and redirect 80 to that.
Then you need to run your go services higher ports, and proxy requests for certain domains over to them with a short caddy file per server something like this (a complete config):