I have HAProxy in front of all my frontend servers working as a load balancer. It redirects all incoming requests to 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 are going to add a few domains for which we do not have a certificate (we do not own those domains, our clients own them). How do I let connections go through on port 80 without redirecting them to https, but only for 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With