I use haproxy 1.6. The haproxy cfg is as following:
frontend http_proxy
bind 0.0.0.0:80
acl test hdr(host) -m str test_haproxy.mydomain.com
use_backend test_server if test
backend test_server
server 32828 10.254.99.34:32828 check
Then I execute curl test_haproxy.mydomain.com, it will response “400 Bad Request”. If I change test_haproxy.mydomain.com to test-haproxy.mydomain.com, curl test-haproxy.mydomain.com will work well. Does haproxy not support underscore in host name? Thanks for the help!