I have a problem with HAProxy configuration. I have several backend servers and in most cases, redirections are being done correctly. It works everywhere except one backend, where Rocket.Chat is configured.HAProxy is redirecting traffic for two domains and subdomains to correct Virtual Machines which are installed on my two bare-metal Hyper-V Servers. Everything is connected via OpenVPN with split-tunnelling. All domains are subdomains are correctly set up in Cloudflare DNS.The problem is that one redirection is not working properly. I have many backends, but only one, with Rocket.Chat is being forwarded to incorrect backend.
Frontend and backend configuration:
bind *:5000 acl url_static path_beg -i /static /images /javascript /stylesheets acl url_static path_end -i .jpg .gif .png .css .js use_backend static if url_static default_backend app#Frontend for traffic to VPN. frontend https--in bind 0.0.0.0:443 ssl crt /etc/cert/ mode http option httplog use_backend cloud if { hdr_dom(host) -i cloud.domain.dev } { dst_port 443 } use_backend cloud if { hdr_dom(host) -i www.cloud.domain.dev } { dst_port 443 } use_backend steldev if { hdr_dom(host) -i www.domain.dev } { dst_port 443 } use_backend steldev if { hdr_dom(host) -i domain.dev } { dst_port 443 } use_backend chat if { hdr_dom(host) -i chatx.domain.dev } { dst_port 443 } use_backend adsb if { hdr_dom(host) -i adsb.domain2.xyz } { dst_port 443 } use_backend monitoring if { hdr_dom(host) -i monitoring.domain.dev } { dst_port 443 } use_backend itsm if { hdr_dom(host) -i itsm.domain.dev } { dst_port 443 } use_backend itsm if { hdr_dom(host) -i itsm.domain2.xyz } { dst_port 443 } use_backend board if { hdr_dom(host) -i board.domain2.xyz } { dst_port 443 }#---------------------------------------------------------------------# static backend for serving up images, stylesheets and such#---------------------------------------------------------------------backend static balance roundrobin server static 127.0.0.1:4331 check---------------------------------------------------------------------# round robin balancing between the various backends#---------------------------------------------------------------------backend app balance roundrobin server app1 127.0.0.1:5001 check server app2 127.0.0.1:5002 check server app3 127.0.0.1:5003 check server app4 127.0.0.1:5004 checkbackend cloud balance leastconn option httpclose cookie JSESSIONID prefix server node1 10.11.12.2:80 cookie A checkbackend monitoring balance leastconn option httpclose cookie JSESSIONID prefix server node1 10.11.12.7:80 cookie A checkbackend steldev balance leastconn option httpclose cookie JSESSIONID prefix server node1 10.11.12.4:80 cookie A checkbackend chat #That one is forwarding to steldev on 10.11.12.4:80, not chat. balance roundrobin server node1 10.11.12.5:3000 cookie A checkbackend itsm balance leastconn option httpclose cookie JSESSIONID prefix server node1 10.11.12.9:80 cookie A checkbackend board balance leastconn option httpclose cookie JSESSIONID prefix server node1 10.11.12.10:80 cookie A checkbackend adsb balance leastconn option httpclose cookie JSESSIONID prefix server node1 10.11.12.3:88 cookie A check
I completely do not know what is wrong with chatx.domain.dev (chat backend) configuration.
If this is important: CentOS 8.3, kernel 4.18, HAProxy v1.8.23
Does anyone of you see any mistake in my configuration? I'm pretty new in HAProxy.