Question

Load Balancing(NGINX) Help Needed.

  • Posted October 6, 2013

Hi, I am working on Load Balancing for my websites… I got this: upstream backend { ny1 192.241.143.207; ny2 162.243.27.154; sf1 162.243.133.133; } The servers host like 7 sites each(all the same files)… What do I put in here: ny1 { location / { proxy_pass http://backend; <-- here } }

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Yes, updated some of them, and some still doing. :) <br>I managed to fix the pdo thing, I didn’t have mysql installed so I had to run: <br>sudo apt-get install php5-mysql <br>to get the drivers.

Did you update your websites with the new location of the MySQL server?

You’re very fast. IT’S OVAR 9000/10 from me. =]

Another thing now… how do I move ALL MySQL database records from my server1 to load-balancer(just so it’s all organised how I love it) and remove it from server1,2,3? Thanks for the help so far!

Sweet! :]

I have 4 servers in total. And I sussed it out! <br>upstream backend { <br> server 192.241.143.207; <br> server 162.243.27.154; <br> server 162.243.133.133; <br>} <br> <br>server { <br> location / { <br> proxy_set_header Host $host; <br> proxy_pass http://backend; <br> } <br>} <br>

Try this config instead: <a href=“https://p.kk7.me/geruxucohu.nginx”>https://p.kk7.me/geruxucohu.nginx</a> <br> <br>Also, it’s worth mentioning that this config should be on a separate nginx load balancer so you will have 4 servers in total.

Nope: <br>upstream backend { <br> ny1 192.241.143.207; <br> ny2 162.243.27.154; <br> sf1 162.243.133.133; <br>} <br> <br>server { <br> location / { <br> proxy_set_header Host $host; <br> proxy_pass http://backend; <br> } <br>} <br> <br>You able to correct me? :/ <br>New to NGINX kinda. :D I like experimenting.