I got 2 nginx servers which are handling 1) reverse proxy and 2) load balancing on two webservers. Since I cannot provide any of the nginx machines IP to the customer so I was thinking to have keepalived on top of 2 Nginx machines with VIP it also checks the fail-over of Nginx.
What I have achieved 1) Successfully installed nginx on 2 machines, so when I hit any nginx server IP I am able to see the application webpage. Even I tested the fail over it works fine.
2) I have installed keepalived on both the machines and tried to generate VIP with the following config
vrrp_script chk_nginx {
script "killall -0 nginx"
interval 2
}
vrrp_instance VI_1 {
interface eth0:1
state MASTER
virtual_router_id 51
priority 100
unicast_src_ip server1_ip
unicast_peer {
server2_ip
}
virtual_ipaddress {
VIP
}
track_script {
chk_nginx
}
}
--> So here when I hit VIP in the web browser I got following error This site can’t be reached
VIP refused to connect. Try: Checking the connection Checking the proxy and the firewall
Not sure what I am missing here . Can someone help me to resolve this issue .So as per my understanding when I hit VIP I should see application web page ?
Regards VG