Home > Software engineering >  HAProxy No server is available to handle this request
HAProxy No server is available to handle this request

Time:10-20

I have HAProxy setup on 192.46.209.80, on port 541 I bound the HAProxy frontend. And on the same server I am running my apache server as well.

This is my /etc/haproxy/haproxy.cfg

 #HAProxy for web servers
    frontend web-frontend
      bind 192.46.209.80:541
      mode http
      default_backend web-backend
    
    backend web-backend
      balance roundrobin
      server server1 192.46.209.80 check port 80
      server server2 192.46.209.82 check port 80

But I am getting 503 service not available.

Note : My question is different from the one already asked because I am serving apache and HAProxy on the same machine. 192.46.209.80

enter image description here

CodePudding user response:

You didn't configure port for backend, so it connects to port used for connection to frontend, which is 541.
server server1 192.46.209.80 check port 80 configures port 80 as port for health checks only.
Try server server1 192.46.209.80:80 check port 80.

  • Related