In HAProxy, how do I redirect all to HTTPS except for certain domains? -


i have haproxy in front of frontend servers working load balancer. redirects incoming requests https:

frontend front_http  mode http  redirect scheme https if !{ ssl_fc }    maxconn 10000  bind 0.0.0.0:80  reqadd x-forwarded-proto:\ http  default_backend back_easycreadoc  frontend front_https  mode http  maxconn 10000  bind 0.0.0.0:443 ssl crt /etc/haproxy/ssl.crt  reqadd x-forwarded-proto:\ https  default_backend back_easycreadoc 

we going add few domains not have certificate (we not own domains, our clients own them). how let connections go through on port 80 without redirecting them https, these domains?

frontend front_http  mode http  acl host_one hdr(host) -i www.one.com  acl host_two hdr(host) -i www.two.com  redirect scheme https if !host_one !host_two  maxconn 10000  bind 0.0.0.0:80  reqadd x-forwarded-proto:\ http  default_backend back_easycreadoc 

http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#redirect


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -