OPNsense Forum

English Forums => General Discussion => Topic started by: eakteam on March 11, 2024, 11:33:12 AM

Title: HAProxy cannt access stats page
Post by: eakteam on March 11, 2024, 11:33:12 AM
Hi, I'm stuggling to be able to access HAProxy stats page and can't make it works.

This is the config for it:

#
# Automatically generated configuration.
# Do not edit this file manually.
#

global
    uid                         80
    gid                         80
    chroot                      /var/haproxy
    daemon
    stats                       socket /var/run/haproxy.socket group proxy mode 775 level admin
    nbthread                    2
    hard-stop-after             60s
    no strict-limits
    maxconn                     10000
    httpclient.resolvers.prefer   ipv4
    tune.ssl.default-dh-param   2048
    spread-checks               2
    tune.bufsize                16384
    tune.lua.maxmem             0
    log                         /var/run/log local0 info
    lua-prepend-path            /tmp/haproxy/lua/?.lua
cache opnsense-haproxy-cache
    total-max-size 4
    max-age 60
    process-vary off

defaults
    log     global
    option redispatch -1
    maxconn 10000
    timeout client 30s
    timeout connect 30s
    timeout server 30s
    retries 3
    default-server init-addr last,libc
    default-server maxconn 10000

# autogenerated entries for ACLs


# autogenerated entries for config in backends/frontends

# autogenerated entries for stats




# Frontend: HTTP (HTTP Frontend)
frontend HTTP
    bind *:80 name *:80
    mode http
    option http-keep-alive

    # logging options
    # ACL: Mail_Subdomains
    acl acl_65eec1ca389293.65127883 hdr_beg(host) -i mail.
    # ACL: Server_Subdomain
    acl acl_65eec21f741e58.90038437 hdr_beg(host) -i server.

    # ACTION: Redirect_Mail_Server
    use_backend Mailcow if acl_65eec1ca389293.65127883 || acl_65eec21f741e58.90038437

# Backend: Mailcow (Mailcow Mail Server)
backend Mailcow
    # health checking is DISABLED
    mode http
    balance source
    # stickiness
    stick-table type ip size 50k expire 30m 
    stick on src
    http-reuse safe
    option forwarded
    option forwardfor
    server Mailcow 172.16.0.3:80

listen local_statistics
    bind            127.0.0.1:8822
    mode            http
    stats uri       /haproxy?stats
    stats realm     HAProxy\ statistics
    stats admin     if TRUE

listen  remote_statistics
    bind            172.16.0.1:8822
    mode            http
    stats uri       /haproxy?stats
    stats hide-version


But it cannot be accessed from LAN via OPNSense from its IP address
Title: Re: HAProxy cannt access stats page
Post by: kingfisher77 on March 17, 2025, 05:11:10 PM
Have you solved it?