Score:0

Multiple (2 or more) physical servers, same IP, nginx setup

tc flag

maybe you can help me... I have about 10 wordpress websites that run on the same linux server running on nginx, everything works. Now I have a need to establish new physical linux server (with new linux OS) that would also run nginx websites. The problem is how to do this since they need to run on the same port (80/443) at the same time. I hear something about reverse nginx proxy setup. Is this the solution? If yes, is reverse nginx need to be 3rd server (in front of these two)? Thanks in advance PS sorry for bad English

Nikita Kipriyanov avatar
za flag
What is the goal? Load balancing? High availability? Why not use ready made cloud solutions, like AWS?
cipre avatar
tc flag
...need to upgrade OS version, php version and also reduce the load of existing server. anyway thanks for advice, I'll consider it.
Score:0
eg flag

You can set up an nginx reverse proxy on your first server so that it redirects the requests for sites residing on the second server. At the same time, the first one can serve its own sites as usual. Here's some documentation: Nginx reverse proxy

This way your router redirects all web traffic (ports 80 & 443) to the first server. Afterward, the first server decides, based on FQDN, if the site is on the second server. If so, Nginx redirects the traffic to the second server.

You don't redirect any router ports to the second one.

Think of each site as a separate Nginx configuration (never mind if you have a single config file or a separate one for each site). They won't affect each other.

cipre avatar
tc flag
OK thanks, need to think how to do this because the current websites are in "production" mode. I am worry about collision on ports when I start nginx service on both servers. Hope first server's config script will solve it (:
Smoke avatar
eg flag
As each site is (or can be) a separate configuration file, adding new configurations won't affect your existing sites. You won't have a collision of ports because ports 80 and 443 are redirected only to your first server. Then it's nginx redirects traffic to your second server. Obviously, one should never test new configurations on production and should always use "nginx -t" before reloading the nginx.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.