-2

I have the following situation that kinda got me stuck, since it's not really my area of expertise.

So, we have an internal server with multiple VMs, each VM hosting one or more applications, running on a specific port. Internally, those apps can be accessed via VMs IP and port or VMs domain name and port (vm1.domain.com:port, vm2.domain.com:port, etc.).

Since we only have one external IP, we mapped it through NoIP and if we want to access those apps externally, it would be something like this: ourname.ddns.net:port. Since we have multiple apps, each app will be accessed using the same address but with a different port.

We are trying to change this so we decided to set up a VM with Nginx that handles all routing. This helps us access all the apps via VMs name and app name: nginxvm.domain.com/app1, nginxvm.domain.com/app2, etc.

Our end goal is to get a domain so that we can access the apps externally using ournewdomain.com/app1, ournewdomain.com/app2 or app1.ournewdomain.com, app2.ournewdomain.com, without any port.

The thing is, I'm not sure how to move forward from this point and what to look for. What does this require? Is there any way to get a domain and just set up all this in a dashboard, like cPanel, or it's a bit more technical than this?

As I mentioned, not quite my area of expertise and I'm kinda stuck here so any help or suggestion would be appreciated.

1
  • 1
    You have no reason to use NoIP. Like the other comment indicates, a reverse proxy can support countless web apps from a single external IP (and widely used by service providers like AWS/Azure etc.) Your current use of nginx isn���t optimized and you might hire an experienced consultant to show you more.
    – Lex Li
    Commented Apr 18 at 13:58

1 Answer 1

1

Get a Domain: First, you'll need to purchase a domain name from a domain registrar if you don't already have one. Set Up DNS: Once you have your domain, you'll need to configure DNS records to point to your server's IP address. This typically involves creating an A record for the domain itself (e.g., ournewdomain.com) and possibly additional records for subdomains (e.g., app1.ournewdomain.com). Configure Nginx: Set up Nginx on your server to act as a reverse proxy. You'll create server blocks (virtual hosts) for each subdomain or subdirectory you want to route traffic to. Each server block will specify the location of the corresponding application.Here's a basic example of what the Nginx configuration might look like for routing to different applications:

server { listen 80; server_name ournewdomain.com;

location /app1 {
    proxy_pass http://vm1.domain.com:port;
}

location /app2 {
    proxy_pass http://vm2.domain.com:port;
}

}

Not the answer you're looking for? Browse other questions tagged .