HAProxy community

Stats page is not accessible

Hi,
When trying to access statistics page as “http://135.250.207.105:9000/stats”, it says “ERR_CONNECTION_REFUSED”.
Any input will be very helpful.

My config file looks as below,

global

log 127.0.0.1 local0 debug

    log stdout  format raw  local0  debug

defaults
mode http
log global
option http-server-close
option httplog
option dontlognull
option redispatch
option forwardfor
retries 3
backlog 4096
timeout client 20s
timeout client-fin 20s
timeout connect 5s
timeout server 20s
timeout tunnel 15m
timeout http-keep-alive 30s
timeout http-request 10s
timeout queue 5s
timeout tarpit 60s
default-server inter 3s rise 2 fall 3

frontend web_gateway
bind *:449 ssl crt /usr/local/etc/haproxy/cert.crt
log 127.0.0.1 local0 debug
redirect scheme https if !{ ssl_fc }
http-request add-header X-Forwarded-Proto https
http-request set-query %[query,regsub(:449,g)]
http-request set-uri %[url,regsub(otntomcat,"$ipv4addr",g)]

http-request set-uri %[url,regsub(/oms1350/pages/otn/mainOtn?initLocalStorage=true,:449/oms1350/pages/otn/mainOtn?initLocalStorage=true,g)]

acl otntomcat_path path_beg -i /oms1350
acl dojoroot_path path_beg -i /dojoroot
acl p1 path_beg -i /jointroot
acl p2 path_beg -i /jquery

acl p3 path_beg -i /lodash
acl p4 path_beg -i /openlayersroot
acl p5 path_beg -i /search
acl p6 path_beg -i /svgutilsroot
acl p7 path_beg -i /d3root
acl p8 path_beg -i /backbone
acl p9 path_beg -i /Cpb
use_backend otntomcat if otntomcat_path || dojoroot_path || p1 || p2 || p3 || p4 || p5 || p6 || p7 || p8 || p9
acl cas_path path_beg -i /cas
acl session_path path_beg -i /session-manager
use_backend nspos_serv if cas_path || session_path
acl fault_path path_beg -i /FaultManagement
use_backend nspos_serv1 if fault_path
acl int_path path_beg -i /internal
use_backend nspos_serv if int_path

use_backend cpb if p9

default_backend nspos_serv

backend otntomcat
mode http
balance roundrobin
log stdout local0 debug
server serv01 otntomcat:8443 check ssl verify none
http-response replace-header Location (.)(\botntomcat\b)(.)$ \1"ipv4addr"\3 http-response replace-header Location (.*)(\b443\b)(.*) \1449\3
http-response replace-header Location (.)(\b8544\b)(.) \1449\3 http-response replace-header Location (.*)(\b8545\b)(.*) \1449\3
http-response replace-header Location (.)(\b8443\b)(.)$ \1449\3
http-response replace-header Location (.)(\b/oms1350/pages/otn\b)(.) \1:449/oms1350/pages/otn\3
http-request add-header X-Forwarded-Proto https if { ssl_fc }

backend nspos_serv
mode http
balance roundrobin
log stdout local0 debug
acl p1 path_beg -i /session-manager
acl p2 path_beg -i /cas
acl p3 path_beg -i /oms1350
acl c1 hdr(Location) urlp(service)
server srv01 nspos:443 check ssl verify none
http-response replace-header Location (.)(\botntomcat\b)(.)$ \1"ipv4addr"\3 http-response replace-header Location (.*)(\b\/cas\/login\b)(.*) \1:449\/cas\/login\3 http-response replace-header Location (.*)(\b\/oms1350\/login\b)(.*) \1:449\/oms1350\/login\3 http-response replace-header Location (.*)(\b\/session-manager\/login\b)(.*) \1:449\/session-manager\/login\3 http-response replace-header Location (.*)(\b:449:449\/session-manager\/login\b)(.*) \1:449\/session-manager\/login\3 http-response replace-header Location (.*)(\b8443\b)(.*) \1449\3
http-response replace-header Location (.)(\b/cas/logout\b)(.) \1:449/cas/logout\3
http-request add-header X-Forwarded-Proto https if { ssl_fc }

backend nspos_serv1
mode http
balance roundrobin
log 127.0.0.1 local0 debug
server srv01 nspos:8544 check ssl verify none
http-response replace-header Location (.)(\b8544\b)(.)$ \1449\3
http-request add-header X-Forwarded-Proto https if { ssl_fc }

listen stats
bind 0.0.0.0:9000 #Listen on all IP’s on port 9000
mode http
stats enable
stats uri /stats
stats refresh 10s
stats admin if TRUE

Thanks

Hi, there was no problem in the configuration.
I did not map the docker container port to the host machine port in the in the docker run command.

Thank you.

1 Like