If I have only 2 servers, can I make each as a backend and also front end?
Server 1: master load balancer / backend server1 Server 2: slave load balancer / backend server2
is it possible?
|
If I have only 2 servers, can I make each as a backend and also front end? Server 1: master load balancer / backend server1 Server 2: slave load balancer / backend server2 is it possible? | |||
|
feedback
|
|
Yes, it's possible and pretty easy to get it done. Check the nginx wiki. You can bind the "webserver" part on a different port than 80 and the load balancer (or proxy if is the case) on port 80. Use something like this: loadb vhost
use the webserver vhost like a default one, just with "listen 81" instead of "listen 80". This is untested, I just copied few of the lines from my config that is running only as a proxy and the backend servers are on different machines... but it should work without any problem. If you also want to load balance between those 2 proxies, try ultramonkey in front of the nginx and all your requests will distributed equal to both servers (or you can do it with nginx) | |||||||||||
feedback
|