# Using Discourse with Cloudflare: Best Practices

**URL:** https://meta.discourse.org/t/using-discourse-with-cloudflare-best-practices/293405
**Category:** Self-Hosting
**Tags:** how-to, cloudflare
**Created:** [January 30, 2024, 2:56am UTC](https://meta.discourse.org/t/using-discourse-with-cloudflare-best-practices/293405 "2024-01-30T02:56:10Z")
**Posts on this page:** 1
**Showing post:** 15

<div class="post-metadata">

### Author: ![thoka](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thoka/32/115652_2.png) [@thoka](https://meta.discourse.org/u/thoka)
#### Post date: [December 3, 2024, 6:30am UTC](https://meta.discourse.org/t/using-discourse-with-cloudflare-best-practices/293405/15 "2024-12-03T06:30:23Z")

</div>

Related to

> [@Rebuild goes into a loop](https://meta.discourse.org/t/rebuild-goes-into-a-loop/339731/10):
>
> As an aside I simply input the cloudflare template at the bottom of app.yml as directed, but launcher came up with a syntax error. I removed it and all is fine.

this part might need some better wording:

> [@Discourse](#):
>
> To ensure the correct IP address gets sent to Discourse, you will want to add the following line to the end of your `containers/app.yml`.
> 
> ```plaintext
> cloudflare.template.yml
> 
> ```

@supermathie Suggestion:

> you will want to add the following line to the end of your templates section in `containers/app.yml`.

as illustrated in [Using Discourse with Cloudflare: Best Practices - #11 by shawa](https://meta.discourse.org/t/using-discourse-with-cloudflare-best-practices/293405/11)

At best, a link to a general how-to about templates in server configuration could be provided also, which I was not able to find at first sight.

---

_[View the full topic](https://meta.discourse.org/t/using-discourse-with-cloudflare-best-practices/293405)._
