global
    log stdout format raw local0
    maxconn 4096

defaults
    log global
    timeout connect 5s
    timeout client  30s
    timeout server  30s

#------------------------------------------------------------
# HTTP listen — port 45245
#------------------------------------------------------------
listen http_45245
    bind :45245
    mode http

    option httpchk
    http-check send meth GET uri /v2/readyz
    http-check expect status 200
	
    server primary ${PRIMARY_HOST}:${PRIMARY_WEBPAGE_PORT} check
    server secondary ${SECONDARY_HOST}:${SECONDARY_WEBPAGE_PORT} check

#------------------------------------------------------------
# HTTP listen — port 8885
#------------------------------------------------------------
listen http_8885
    bind :8885
    mode http

    option httpchk GET /data/doc/index.html
	
    server primary ${PRIMARY_HOST}:${PRIMARY_API_PORT} check
    server secondary ${SECONDARY_HOST}:${SECONDARY_API_PORT} check

#------------------------------------------------------------
# TCP listen — port 1885
#------------------------------------------------------------
listen tcp_1885
    bind :1885
    mode tcp

    option tcplog
	
    server primary ${PRIMARY_HOST}:${PRIMARY_MQTT_PORT} check
    server secondary ${SECONDARY_HOST}:${SECONDARY_MQTT_PORT} check
