# How to install mod\_cloudflare

**URL:** https://meta.discourse.org/t/how-to-install-mod-cloudflare/134098
**Category:** Support
**Created:** [November 22, 2019, 1:45am UTC](https://meta.discourse.org/t/how-to-install-mod-cloudflare/134098 "2019-11-22T01:45:27Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Nikhil\_Darji](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nikhil_darji/32/161909_2.png) [@Nikhil\_Darji](https://meta.discourse.org/u/Nikhil_Darji)
#### Post date: [November 22, 2019, 1:45am UTC](https://meta.discourse.org/t/how-to-install-mod-cloudflare/134098/1 "2019-11-22T01:45:27Z")

</div>

Hello,  
is there any way to install mod\_cloudflare? becuase when users getting logged discourse showing cloudflare’s IPs i’m not able to find proper guide

---

<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: [November 22, 2019, 1:59am UTC](https://meta.discourse.org/t/how-to-install-mod-cloudflare/134098/2 "2019-11-22T01:59:44Z")

</div>

There’s no need to install mod\_cloudflare - a cloudflare template is provided which will handle passing the correct IP address in.

Please note that none of Cloudflare’s optimisation features are supported with Discourse. You’re going to need a page rule to ‘disable performance’ otherwise Cloudflare will alter the payload and leave your site in an unsupported state.

[![](https://global.discourse-cdn.com/meta/original/3X/a/6/a6c869b853fb2765a8fd9d6df72b939b4d284d72.png) ](https://global.discourse-cdn.com/meta/original/3X/a/6/a6c869b853fb2765a8fd9d6df72b939b4d284d72.png)

---

<div class="post-metadata">

### Author: ![Nikhil\_Darji](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nikhil_darji/32/161909_2.png) [@Nikhil\_Darji](https://meta.discourse.org/u/Nikhil_Darji)
#### Post date: [November 22, 2019, 3:21am UTC](https://meta.discourse.org/t/how-to-install-mod-cloudflare/134098/3 "2019-11-22T03:21:08Z")

</div>

tried it still showing cloudflare IPS

![Jdc4GJn8QCOtQROu13aAUw](https://global.discourse-cdn.com/meta/original/3X/f/9/f9d199577a171d03284769206f387340b87aab63.png)

screen shot of cloudflare rule

 ![image](https://global.discourse-cdn.com/meta/original/3X/5/3/534fafce228795d3025e7644a26d83e4e806929a.png)

---

<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: [November 22, 2019, 3:21am UTC](https://meta.discourse.org/t/how-to-install-mod-cloudflare/134098/4 "2019-11-22T03:21:37Z")

</div>

Did you rebuild after editing your YML file?

---

<div class="post-metadata">

### Author: ![Nikhil\_Darji](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nikhil_darji/32/161909_2.png) [@Nikhil\_Darji](https://meta.discourse.org/u/Nikhil_Darji)
#### Post date: [November 22, 2019, 3:22am UTC](https://meta.discourse.org/t/how-to-install-mod-cloudflare/134098/5 "2019-11-22T03:22:34Z")

</div>

yes i did rebuild after editing

---

<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: [November 22, 2019, 3:23am UTC](https://meta.discourse.org/t/how-to-install-mod-cloudflare/134098/6 "2019-11-22T03:23:19Z")

</div>

And what syntax did you use in the yml for the Cloudflare template?

---

<div class="post-metadata">

### Author: ![Nikhil\_Darji](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nikhil_darji/32/161909_2.png) [@Nikhil\_Darji](https://meta.discourse.org/u/Nikhil_Darji)
#### Post date: [December 9, 2019, 2:19pm UTC](https://meta.discourse.org/t/how-to-install-mod-cloudflare/134098/7 "2019-12-09T14:19:25Z")

</div>

i’m sorry i have not modified the yml just disabled performance from cloudflare can you share what to add in yml?

---

<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: [December 9, 2019, 4:55pm UTC](https://meta.discourse.org/t/how-to-install-mod-cloudflare/134098/8 "2019-12-09T16:55:06Z")

</div>

Add the Cloudflare template to your templates section:

Under `templates:` add:

`- "templates/cloudflare.template.yml"`

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [December 14, 2022, 4:18pm UTC](https://meta.discourse.org/t/how-to-install-mod-cloudflare/134098/9 "2022-12-14T16:18:44Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
