# Redirect http to https

**URL:** <https://discourse.haproxy.org/t/redirect-http-to-https/4488>\
**Category:** Help!\
**Created:** [November 8, 2019, 9:31am UTC](https://discourse.haproxy.org/t/redirect-http-to-https/4488 "2019-11-08T09:31:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![giorg](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/giorg/32/1019_2.png) [@giorg](https://discourse.haproxy.org/u/giorg)\
**Post date:** [November 8, 2019, 9:31am UTC](https://discourse.haproxy.org/t/redirect-http-to-https/4488/1 "2019-11-08T09:31:14Z")

</div>

hello,  
I have this setup: ubuntu with haproxy and let’s encrypt with many certificates, lxc containers with websites listening on port 80. If I browse using https everything works like a charm, but if I try with http they go in timeout, I would like they are redirected to https instead. Here is my haproxy configuration:

frontend http-frontend  
bind \*:80  
redirect scheme https if !{ ssl\_fc }

frontend web-ssl  
bind \*:443 ssl crt /etc/ssl/my.domain/my.domain.pem … and others certs  
acl letsencrypt-acl path\_beg /.well-known/acme-challenge/  
use\_backend letsencrypt-backend if letsencrypt-acl  
acl mydomain hdr(host) -i my.domain  
use\_backend mydomain if mydomain

backend mydomain  
mode http  
redirect scheme https if !{ ssl\_fc }  
server mydomain 10.204.177.89:80

any help?  
thanks a lot

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [November 8, 2019, 3:52pm UTC](https://discourse.haproxy.org/t/redirect-http-to-https/4488/2 "2019-11-08T15:52:23Z")

</div>

If you see a timeout, you probably have some connection/network issues. Check firewall/iptables settings. Make sure you can actually reach port 80.
