yum install epel-release
yum install nginx
systemctl start nginx
systemctl enable nginx
vi /etc/nginx/nginx.conf
events { }
http {
upstream api {
#least_conn; #other options are also available
server 192.168.0.57:6443;
server 192.168.0.93:6443 weight=3;
server 192.168.0.121:6443 max_fails=3 fail_timeout=30;
}
server {
listen 8888 ssl;
ssl_certificate test.crt;
ssl_certificate_key test.key;
location / {
proxy_pass https://api;
}
server {
listen 80 default;
location / {
proxy_pass https://api;
}
}
}
Loadbalancing algorithm:
least_conn
ip_hash
weight=5
max_fails and fail_timeout
More on : http://nginx.org/en/docs/http/load_balancing.html#nginx_load_balancing_health_checks