# How we split Plug.SSL to control SSL redirection

**URL:** <https://forum.devtalk.com/t/how-we-split-plug-ssl-to-control-ssl-redirection/2988>\
**Category:** Blogs/Articles/Talks/Podcasts\
**Tags:** elixir, elixir-plug, ssl, https\
**Created:** [9 October 2020 09:22 UTC](https://forum.devtalk.com/t/how-we-split-plug-ssl-to-control-ssl-redirection/2988 "2020-10-09T09:22:48Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![AstonJ](https://forum.devtalk.com/user_avatar/forum.devtalk.com/astonj/32/7_2.png) [@AstonJ](https://forum.devtalk.com/u/AstonJ)\
**Post date:** [9 October 2020 15:52 UTC](https://forum.devtalk.com/t/how-we-split-plug-ssl-to-control-ssl-redirection/2988/3 "2020-10-09T15:52:19Z")

</div>

Great post Sascha, I am sure it will help a lot of people!

I don’t have a Phoenix app in production yet but for anyone using HAProxy, these lines on the frontend may also be of help:

```auto
reqadd X-Forwarded-Proto:\ https if { ssl_fc }
redirect scheme https if ssl_redirect_hosts !{ ssl_fc }
redirect scheme https code 301 if !{ ssl_fc }

```

In conjunction with configuring plug to handle `X-Forwarded-*` headers as per Sascha’s post.

---

_[View the full topic](https://forum.devtalk.com/t/how-we-split-plug-ssl-to-control-ssl-redirection/2988)._
