# Trouble setting up http-to-https redirection

**URL:** <https://forums.suse.com/t/trouble-setting-up-http-to-https-redirection/1722>\
**Category:** Rancher 1.x\
**Created:** [February 14, 2016, 7:34pm UTC](https://forums.suse.com/t/trouble-setting-up-http-to-https-redirection/1722 "2016-02-14T19:34:38Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![rsilva4](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/rsilva4/32/1438_2.png) [@rsilva4](https://forums.suse.com/u/rsilva4)\
**Post date:** [December 12, 2016, 3:28pm UTC](https://forums.suse.com/t/trouble-setting-up-http-to-https-redirection/1722/5 "2016-12-12T15:28:46Z")

</div>

Do as described here: [https://github.com/rancher/rancher/issues/3505#issuecomment-264308277](https://github.com/rancher/rancher/issues/3505#issuecomment-264308277)

1. Add selector rule in your balancer with protocol “HTTP”, request host “\*”, port “80” and target “foo=bar” (actually any target that won’t select any service). It will force balancer to expose 80 port, but it won’t actually change haproxy.cfg, because there is no service with the target.
2. In “Custom haproxy.cfg” add this  
frontend http-frontend  
bind \*:80  
mode http  
redirect scheme https if !{ ssl\_fc }
3. Save balancer configs. All http requests will be redirected to https 😉

---

_[View the full topic](https://forums.suse.com/t/trouble-setting-up-http-to-https-redirection/1722)._
