Load Balancinng Nginx with two vps server
CentOS 6.4:
Debian/Ubuntu:
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:
Once ready we can restart the Nginx service:
1
|
sudo /etc/init.d/nginx start
|
If you have installed the
nginx package from the Ubuntu repositories, you will have two directories./etc/nginx/sites-enabled and /etc/nginx/sites-available .
In the main nginx configuration,
/etc/nginx/nginx.conf , you have the following line:
So basically to list all available virtualhosts, you can run the following command:
To activate one of them, run the following command:
|
Comments
Post a Comment