Posts

Showing posts from September, 2017

Load Balancinng Nginx with two vps server

CentOS 6.4: 1 sudo nano / etc / nginx / conf . d / default . conf Debian/Ubuntu: 1 2 3 4 5 6 7 sudo nano / etc / nginx / sites - available / default upstream server_array {    server server1 . yourdomain . com ;    server server2 . yourdomain . com ;    server server3 . yourdomain . com ; } where server_array is the name of the server group which will be used for the load balancing configuration. Inside the same file we can "tell" the virtual host to use the server group: 1 2 3 4 5 6 7 server {      listen 80 ;      server_name yourdomain . com ;      location / {          proxy_pass http : //server_array;      } } Once ready we can restart the Nginx service: 1 sudo / etc / init . d / nginx start down vote If you have installed the  nginx  package from the Ubuntu repositories, you will have two directories. /etc/nginx/sites-enab