Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4849

HAProxy showing initial "503 Service Unavailable" followed by successful response on refresh

$
0
0

Hey everybody,

I have multiple domain and their corresponding back-end server’s . I want to Use HaProxy as Reverse Proxy for my domains.

whenever I hit that domain it sometime it give me response and sometime it give me 503 HaProxy error,*
below is the log of that error

  • Jun 12 09:50:07 HAProxy haproxy[101105]: 192.168.37.1:48766 [12/Jun/2024:09:50:07.719] http_frontend default_backend/ 0/-1/-1/-1/0 503 216 - - SC-- 1/1/0/0/0 0/0 “GET /industry/advertising-translation-services HTTP/1.1”

  • Jun 12 10:03:53 HAProxy haproxy[101092]: 192.168.37.1:48196 [12/Jun/2024:10:03:50.785] http_frontend default_backend/localhost 0/0/-1/-1/3006 503 216 - - SC-- 1/1/0/0/3 0/0 “GET /industry/advertising-translation-services HTTP/1.1”

after multiple refreshed it works and the log is

  • Jun 12 09:41:19 HAProxy haproxy[125808]: 192.168.37.1:54442 [12/Jun/2024:09:41:19.551] http_front servers/qadev 0/0/0/44/45 200 510642 - - ---- 2/2/0/0/0 0/0 “GET /industry/advertising-translation-services HTTP/1.1”

I have spend almost 1.5 week on this error but failed to find the solution.

this is my cnf of Haproxy.


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

defaults
    log     global
    mode    http
    option  httplog
    option  dontlognull
    timeout connect 5000
    timeout client  50000
    timeout server  50000
    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 marshub_com
    bind *:8095

    acl ccjkcrmdev.marshub.com hdr(host) -i -m beg ccjkcrmdev.marshub.com
    use_backend ccjkcrmdev_backend if ccjkcrmdev.marshub.com



  acl logstash.marshub.com hdr(host) -i -m beg logstash.marshub.com
    use_backend logstash_backend if logstash.marshub.com

backend ccjkcrmdev_backend
    server ccjkcrmdev_server 192.156.65.24:8090 check

backend logstash_backend
    server logstash_server 192.156.23.78:8092 check

Kindly please help to resolve that issue, i also tried adding a default back-end server but still same error.

my main goal is to use HaProxy to route request to their corresponding back-end server’s based on the domain name.

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 4849

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>