# Trying to use Let's Encrypt + Cloudflare

**URL:** https://meta.discourse.org/t/trying-to-use-lets-encrypt-cloudflare/108031
**Category:** Support
**Created:** [January 31, 2019, 3:52pm UTC](https://meta.discourse.org/t/trying-to-use-lets-encrypt-cloudflare/108031 "2019-01-31T15:52:12Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [January 31, 2019, 8:11pm UTC](https://meta.discourse.org/t/trying-to-use-lets-encrypt-cloudflare/108031/4 "2019-01-31T20:11:55Z")

</div>

> [@cean](#):
>
> So, my website is behind Cloudflare. I am trying to make it https.
> 
> I tried using Cloudflare SSL (Full (strict)) but no, it did not work. I tried using Let’s Encrypt’s SSL which would not work because it is behind such proxy stuff as stated in official tutorial.

Ok, step one to do this involves temporarily unchecking the orange cloud and bypassing Cloudflare entirely. To issue the initial certificate Let’s Encrypt needs direct communication with your server.

Ensure that in your app.yml the following lines are uncommented:

- “templates/web.ssl.template.yml”
- “templates/web.letsencrypt.ssl.template.yml”

and add this one:

- “templates/cloudflare.template.yml”

There’s little to no risk in doing this, so click on the orange cloud to disable CloudFlare, configure Let’s Encrypt. When your site is working again under HTTPS you also need to make a change within Discourse enabling the `force_https` setting under /admin.

Once your server is communicating via HTTPS you can change one more setting at Cloudflare if there are no other sites or applications under the same domain. Visit the ‘Crypto’ tab at Cloudflare and swap SSL from ‘Flexible’ to ‘Full (Strict)’.

Note that certain CloudFlare features are incompatible with Discourse, you’re going to need to create the following page rule:

 ![](https://global.discourse-cdn.com/meta/original/3X/1/3/13bc9663ffd3e069a6b6fb91a888ecc72a9b932b.png)

And disable Brotli, which is under the ‘Speed’ tab of your domain:

 ![18%20PM](https://global.discourse-cdn.com/meta/original/3X/8/2/822756e5a85c6655fb8eecbd526180a089fceea2.png)

> [@itsbhanusharma](#):
>
> Easiest will be to disable ssl on discourse side and let cloudflare manage ssl for you but that’s not okay at all times.

This is neither easy, not a good idea. It’s easy to secure Discourse using Let’s Encrypt once you allow Let’s Encrypt to enrol the certificate. Troubleshooting the mixed scenario is much more hassle.

---

_[View the full topic](https://meta.discourse.org/t/trying-to-use-lets-encrypt-cloudflare/108031)._
