Haproxy 503 Service Unavailable with NOSRV

haproxy

Im running HAProxy with 3 Apache servers as backend servers.
problem is every 2 or 3 request ive got 503 Service Unavailable error and in log files i have this message :

 Oct 19 14:46:57 HAProxy1-www haproxy[31107]: 172.20.30.176:39050 [19/Oct/2015:14:46:57.501] http-in http-in/<NOSRV> -1/-1/-1/-1/0 503 213 - - SC-- 0/0/0/0/0 0/0 "GET / HTTP/1.1"

i checked google , mailing lists and irc find out SC flag is connection refuse happening between haproxy and backend server , i have no firewalls and all servers are in same subnet.
i use this options in my haproxy.conf

    global
        log /dev/log    local0 err
        log /dev/log    local1 err
        chroot /var/lib/haproxy
        stats socket /run/haproxy/admin.sock mode 660 level admin
        stats timeout 30s
        user haproxy
        group haproxy
        daemon

        # Default SSL material locations
        ca-base /etc/ssl/certs
        crt-base /etc/ssl/private

        # Default ciphers to use on SSL-enabled listening sockets.
        # For more information, see ciphers(1SSL). This list is from:
        #  https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
        ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS
        ssl-default-bind-options no-sslv3

defaults
        log     global
        mode    http
        option  httplog
        option  dontlognull
        option  forwardfor
        option  http-server-close
        option  redispatch
        timeout connect 5000
        timeout client  50000
        timeout server  50000
        retries 3
        errorfile 400 /etc/haproxy/errors/400.http
        errorfile 403 /etc/haproxy/errors/403.http
        errorfile 408 /etc/haproxy/errors/408.http
        errorfile 500 /etc/haproxy/errors/500.http
        errorfile 502 /etc/haproxy/errors/502.http
        errorfile 503 /etc/haproxy/errors/503.http
        errorfile 504 /etc/haproxy/errors/504.http
frontend http-in
        bind 172.18.0.250:80
        mode http
        # default_backend host_httpd-in
        acl host_http-in hdr_sub(host) -i domain.ir
        use_backend host_httpd-in if host_http-in
backend host_httpd-in
        mode http
        balance roundrobin
        # balance leastconn
        option httpclose
        option forwardfor
        # option forwardfor header X-Forwarded-For
        # reqidel ^X-Real-IP
        #cookie JSESSIONID prefix
        #cookie SERVERID insert indirect
        # option httpchk HEAD /index.html HTTP/1.0
        server www1      172.18.0.13:80       check
        server www2      172.18.0.14:80       check
        server www3      172.18.0.15:80       check
userlist stats-auth
    group admin    users arash
    user  arash    insecure-password arash123
    group readonly users system
    user  system  insecure-password haproxy

listen stats
    bind 0.0.0.0:4444
    use_backend stats_auth
backend stats_auth
    stats enable
    stats hide-version
    stats uri /stats
    acl AUTH       http_auth(stats-auth)
    acl AUTH_ADMIN http_auth_group(stats-auth) admin
    stats http-request auth unless AUTH
    stats admin if AUTH_ADMIN

any suggestions for me ?

Best Answer

Try to use

bind *:80

instead of

bind 172.18.0.250:80