Hey Ranjith,
Thanks for the reply and suggestion. I make the suggested changes in nginx.conf on my nginx-lb
upstream backend {
server 192.168.1.41:32606;
server 192.168.1.42:32606;
}
# This server accepts all traffic to port 80 and passes it to the upstream.
server {
listen 80;
location / {
proxy_pass http://backend;
}
}
Now when i try to access my web page via load balancer ip , i am getting bad gateway error on the browser and i am also getting following errors in error log file on nginx-lb
[root@lb1 ~]# tailf /var/log/nginx/error.log
2020/08/11 14:28:27 [crit] 1478#0: *1 connect() to 192.168.1.41:32606 failed (13: Permission denied) while connecting to upstream, client: 192.168.1.3, server: , request: "GET / HTTP/1.1", upstream: "http://192.168.1.41:32606/", host: "lb-http.local"
2020/08/11 14:28:28 [error] 1478#0: *1 no live upstreams while connecting to upstream, client: 192.168.1.3, server: , request: "GET / HTTP/1.1", upstream: "http://backend/", host: "lb-http.local"
2020/08/11 14:28:47 [crit] 1478#0: *1 connect() to 192.168.1.42:32606 failed (13: Permission denied) while connecting to upstream, client: 192.168.1.3, server: , request: "GET / HTTP/1.1", upstream: "http://192.168.1.42:32606/", host: "lb-http.local"
2020/08/11 14:28:47 [crit] 1478#0: *1 connect() to 192.168.1.41:32606 failed (13: Permission denied) while connecting to upstream, client: 192.168.1.3, server: , request: "GET / HTTP/1.1", upstream: "http://192.168.1.41:32606/", host: "lb-http.local"
2020/08/11 14:30:48 [crit] 1478#0: *8 connect() to 192.168.1.42:32606 failed (13: Permission denied) while connecting to upstream, client: 192.168.1.3, server: , request: "GET / HTTP/1.1", upstream: "http://192.168.1.42:32606/", host: "192.168.1.151"
2020/08/11 14:30:48 [crit] 1478#0: *8 connect() to 192.168.1.41:32606 failed (13: Permission denied) while connecting to upstream, client: 192.168.1.3, server: , request: "GET / HTTP/1.1", upstream: "http://192.168.1.41:32606/", host: "192.168.1.151"
2020/08/11 14:30:49 [error] 1478#0: *8 no live upstreams while connecting to upstream, client: 192.168.1.3, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://backend/favicon.ico", host: "192.168.1.151", referrer: "http://192.168.1.151/"
2020/08/11 14:30:58 [error] 1478#0: *12 no live upstreams while connecting to upstream, client: 192.168.1.3, server: , request: "GET / HTTP/1.1", upstream: "http://backend/", host: "lb-http.local"
2020/08/11 14:31:10 [crit] 1478#0: *12 connect() to 192.168.1.42:32606 failed (13: Permission denied) while connecting to upstream, client: 192.168.1.3, server: , request: "GET / HTTP/1.1", upstream: "http://192.168.1.42:32606/", host: "lb-http.local"
2020/08/11 14:31:10 [crit] 1478#0: *12 connect() to 192.168.1.41:32606 failed (13: Permission denied) while connecting to upstream, client: 192.168.1.3, server: , request: "GET / HTTP/1.1", upstream: "http://192.168.1.41:32606/", host: "lb-http.local"