HProxy Formatting issues?

Hello Everyone

I am trying to set up two HProxy on Photon to use them as Loadbalancers for my VMWAre Horizon connection servers. Here is my config:

# HaProxy configuration

# Global definitions
global
  chroot /var/lib/haproxy
  stats socket /var/lib/haproxy/stats  # Corrected 'haprxoy' to 'haproxy'
  daemon

defaults
  timeout connect 5s
  timeout client 30s
  timeout server 30s

# Statistics & Admin configuration
userlist stats-auth
  group admin users admin
  user admin insecure-password LetMeIn
  group ro users stats
  user stats insecure-password ReadOnly

frontend stats-http8404
  mode http
  bind 192.168.1.250:8404
  default_backend statistics

backend statistics
  mode http
  stats enable
  stats show-legends
  stats show-node
  stats refresh 30s
  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
  stats uri /stats

# HORIZON Connection Servers
frontend horizon-http
  mode http
  bind 192.168.1.40:80
  # Redirect http to https
  redirect scheme https if !{ ssl_fc }

frontend horizon-https
  mode tcp
  bind 192.168.1.40:443
  default_backend horizon

backend horizon
  mode tcp
  option ssl-hello-chk
  balance source
  server HRZSRV0102 192.168.1.62 ssl verify none weight 1 check inter 30s fastinter 2s downinter 5s rise 3 fall 3
  server HRZSRV0202 192.168.1.82 ssl verify none weight 1 check inter 30s fastinter 2s downinter 5s rise 3 fall 3

I checked with hproxy -c, the errors don’t make much sense to me, since I defined “bind” and “default” on these lines:

Do you may see what Im doing wrong?

Thank you for your help.

Kind regards,

Gabe

PS: I am disabling SSL for now because I received an SSL error when trying to connect over the loadbalancer to the servers before.

The configuration that actually is in /etc/haproxy/haproxy.cfg is not what you posted above.

Indeed it does not raise the errors you shared, but raises other errors (not having a port defined in the horizon backend, despite health check being enabled, so health check does not know which port to send the health check to):

lukas@dev:~/haproxy-2.6$ ./haproxy -c -f ../cert/discourse9076.cfg
[NOTICE]   (24544) : haproxy version is 2.6.15
[NOTICE]   (24544) : path to executable is ./haproxy
[ALERT]    (24544) : config : config: backend 'horizon': server 'HRZSRV0102' has neither service port nor check port nor tcp_check rule 'connect' with port information.
[ALERT]    (24544) : config : config: backend 'horizon': server 'HRZSRV0202' has neither service port nor check port nor tcp_check rule 'connect' with port information.
[ALERT]    (24544) : config : Fatal errors found in configuration.
lukas@dev:~/haproxy-2.6$

Hello Lukas

Thank you for your help.
Sorry, Im quite new with hproxy…so you mean I shouldnt save the configuration there? It is where the file is stored at the moment…

And How can I defined these ports?

No, that is not what I mean, the filename is fine.

I mean that the content of /etc/haproxy/haproxy.cfg is not what you posted above, and you should triple check why that is.

But it is…? The file is not overwritten or anything. Here i’m opening it:

And thats the file:

Is it possible that it looks for a config elsewhere…?

Your initial suggestion that the error messages in haproxy with this particular configuration don’t make sense are correct. They don’t make any sense, and like I said if haproxy would really read this configuration, the error message would be totally different.

I cannot possibly tell you why that is.