0

I'm currently using one server to run nginx with multiple sites, but as for now I'm going to start another project will be run at a separate machine on the same network.

The sites I'm running now is running all on port 80, and nginx handles to view the correct site to correct domain and so on.

My question is now if it would be possible to link the new machine to the old machine, so the nginx servers can talk together or something, so all machines listen to port 80 and then divide the traffic to correct place / machine / site.

So machine 1 can still run the 4 websites. Machine 2 will run 2 more project sites, but all will listen to port 80. Somekind of link between the nginx?

Regards, half

half
  • 1

1 Answers1

0

So you have one external IP with multiple domains and want to serve them from server 1 or 2 based on the domain name, all using the same port? It’s kind of doable. Essentially you can configure server 1 to ReverseProxy the additional domains through server2. All traffic will still go through server1, but the 2 domains will just be proxies through it to server 2. Alternatively deploy a server which just proxies and chooses either server 1 or server 2 as destination. In any case, you are looking to google ReverseProxy. For port 80, there are some routers that can do DPI and work out the destination based on the contents of the packets, but that’s way more expensive than just using ReverseProxy to forward traffic to another server for some domains.