TopHi
TopHi

Reputation: 21

nginx load balance structure

I have a website that is growing so my dedicated server can't handle and the lag is real deal. So I decided to try cloud hosting and for this purpose I will use nginx as load balancer.

Qustion 1. If I configure the main webserver where domain.tld is located as load balancer like the example here will I be able to use the same server for all my other domains(right now I use normal nginx config to maintan 10 small websites on the same webserver), or the main role will be ONLY to balance and redirect the traffic.

Question 2. Shall I put copy of the files on the mirror servers ? Example : my website is in the http_web folder , where he communicate with MYSQL server. How the requests are handled ? What happens when the balance server redirect the client to the server1 ?

Question 3. I plan to start with this structure: Load balancer (dedicated server) + Mysql -> http servers1, server2,,, on demand3..4..5.. Is that ok?

Upvotes: 0

Views: 157

Answers (1)

madmanali93
madmanali93

Reputation: 273

This diagram should help with how you should set it up. Forgive me if I missed your point to your question. So the green is what is public and red is your private internal network. So your load balancer which you want as nginx has two networks connected to it. Your external public network and your internal network. The lb should handle all the ip's coming from your clients. Then nginx delegates the client to one of the webapps through the private internal network. I hope this helps.

enter image description here

Upvotes: 1

Related Questions