Jake He
Jake He

Reputation: 2815

Server web1 is DOWN, reason: Layer7 wrong status, code: 503, info: "Service Temporarily Unavailable"

I trying to configure a Haproxy load balancer in layer 4. It works. But the backend servers fails the health check. Haproxy says it is down. How do I fix it?

Do I have to add this? I tried, it made no difference.

option httpchk HEAD /app.php HTTP/1.1\r\nHost:orocampus.tk

global
    log /dev/log    local0
    log /dev/log    local1 notice
    chroot /var/lib/haproxy
    stats timeout 30s
    user haproxy
    group haproxy
    daemon

defaults
    log global
    mode    http
    option  httplog
    option  dontlognull
        option httpchk
        timeout connect 5000
        timeout client  50000
        timeout server  50000

frontend ft_web
  bind 0.0.0.0:80
  default_backend orocampus

backend orocampus
  mode http
  balance roundrobin
  cookie SERVERID insert indirect nocache
  server web1 app1.orocampus.tk:80 check cookie web1
  server web2 app2.orocampus.tk:80 check cookie web2

Upvotes: 0

Views: 6528

Answers (1)

Jake He
Jake He

Reputation: 2815

  option httpchk HEAD /app.php HTTP/1.1\r\nHost:\ orocampus.tk

This solved it.

Upvotes: 2

Related Questions