Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am using Haproxy to separate http and https with different domain setting, but domain limitation with http not working well. My setting as following. Any idea?

frontend ha_8080
  mode tcp
  bind *:8080
  tcp-request content accept if { req_ssl_hello_type 1 }
  tcp-request inspect-delay 100ms
  tcp-request content accept if HTTP
  acl is_using_ssl req.ssl_hello_type gt 0

  acl is_abc hdr_dom(host) -i abc.com
  use_backend http_server if !is_using_ssl is_abc  #it works and only works on abc.com,
  use_backend local_server1 if is_using_ssl is_abc #https will not working
  use_backend local_server1 if is_using_ssl        #it works, but I need it work only on abc.com


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
482 views
Welcome To Ask or Share your Answers For Others

1 Answer

hdr_dom(host) not work for https(ssl).

I should change to using req_ssl_sni.

My final setting as following.

frontend ha_8080
  mode tcp
  bind *:8080
  tcp-request content accept if { req_ssl_hello_type 1 }
  tcp-request inspect-delay 100ms
  tcp-request content accept if HTTP
  acl is_abc hdr_dom(host) -i abc.com
  acl is_abc_ssl req_ssl_sni -i abc.com
  use_backend http_server if is_abc 
  use_backend local_server1 if is_abc_ssl 


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...