# Simple method for doing http -\> https frontend redirects in HAProxy?

**URL:** <https://discourse.haproxy.org/t/simple-method-for-doing-http-https-frontend-redirects-in-haproxy/2035>\
**Category:** Help!\
**Created:** [January 25, 2018, 7:31pm UTC](https://discourse.haproxy.org/t/simple-method-for-doing-http-https-frontend-redirects-in-haproxy/2035 "2018-01-25T19:31:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![onetech-it](https://avatars.discourse-cdn.com/v4/letter/o/85f322/32.png) [@onetech-it](https://discourse.haproxy.org/u/onetech-it)\
**Post date:** [January 25, 2018, 7:31pm UTC](https://discourse.haproxy.org/t/simple-method-for-doing-http-https-frontend-redirects-in-haproxy/2035/1 "2018-01-25T19:31:12Z")

</div>

I have a site doing simple reverse proxying (https 443 haproxy frontend --\> http 8080 on the backend).

Is there a simple config entry for HAProxy to force http 80 requests on the front end, to redirect to https 443 on the front end and then get proxied to the backend?

---

<div class="post-metadata">

**Author:** ![kkoppel](https://avatars.discourse-cdn.com/v4/letter/k/d78d45/32.png) [@kkoppel](https://discourse.haproxy.org/u/kkoppel)\
**Post date:** [January 26, 2018, 7:19am UTC](https://discourse.haproxy.org/t/simple-method-for-doing-http-https-frontend-redirects-in-haproxy/2035/2 "2018-01-26T07:19:12Z")

</div>

Just make sure your frontend also binds on port 80 and add this line somewhere near the top of your frontend definition (request processing stops at this line and the client gets externally redirected to the same URL with HTTPS):  
http-request redirect scheme https if !{ ssl\_fc }

Check out the docs here:  
[http://cbonte.github.io/haproxy-dconv/1.7/configuration.html#http-request](http://cbonte.github.io/haproxy-dconv/1.7/configuration.html#http-request)  
[http://cbonte.github.io/haproxy-dconv/1.7/configuration.html#4.2-redirect%20scheme](http://cbonte.github.io/haproxy-dconv/1.7/configuration.html#4.2-redirect%20scheme)
