# Issue with Cloudflare template

**URL:** https://meta.discourse.org/t/issue-with-cloudflare-template/35113
**Category:** Bug
**Created:** [October 30, 2015, 5:52pm UTC](https://meta.discourse.org/t/issue-with-cloudflare-template/35113 "2015-10-30T17:52:00Z")
**Posts on this page:** 12
**Page:** 1

<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: [October 30, 2015, 5:52pm UTC](https://meta.discourse.org/t/issue-with-cloudflare-template/35113/1 "2015-10-30T17:52:00Z")

</div>

Recent rebuilds with Cloudflare support enabled through the official template result in an erroneous line appearing in /etc/nginx/conf.d/discourse.conf:

```
set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 103.31.4.0/22;
set_real_ip_from 104.16.0.0/12;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 141.101.64.0/18;
set_real_ip_from 162.158.0.0/15;
set_real_ip_from 172.64.0.0/13;
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 188.114.96.0/20;
set_real_ip_from 190.93.240.0/20;
set_real_ip_from 197.234.240.0/22;
set_real_ip_from 198.41.128.0/17;
set_real_ip_from 199.27.128.0/21;
set_real_ip_from ;
set_real_ip_from 2400:cb00::/32;
set_real_ip_from 2405:8100::/32;
set_real_ip_from 2405:b500::/32;
set_real_ip_from 2606:4700::/32;
set_real_ip_from 2803:f800::/32;

```

The result is that the Discourse instance becomes unavailable, with the production.log flooded by:

```
invalid number of arguments in "set_real_ip_from" directive in /etc/nginx/conf.d/discourse.conf

```

Commenting out the line immediately resolves the issue.

Has the source data at Cloudflare changed? At the minimum it looks like they might be sending a blank row that will need trimming to avoid recurrences of this issue.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [October 30, 2015, 7:57pm UTC](https://meta.discourse.org/t/issue-with-cloudflare-template/35113/2 "2015-10-30T19:57:54Z")

</div>

We need to fix this @riking @mpalmer

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [October 30, 2015, 8:08pm UTC](https://meta.discourse.org/t/issue-with-cloudflare-template/35113/3 "2015-10-30T20:08:12Z")

</div>

Ooh, that’s no good. I’ll sort that out right now.

---

<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: [October 30, 2015, 8:50pm UTC](https://meta.discourse.org/t/issue-with-cloudflare-template/35113/4 "2015-10-30T20:50:08Z")

</div>

Presumably users will have to update their docker images to benefit from the fix? Anyone who just rebuilds will end up in the same position as us?

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [October 30, 2015, 9:04pm UTC](https://meta.discourse.org/t/issue-with-cloudflare-template/35113/5 "2015-10-30T21:04:51Z")

</div>

Yes, users will have to pull the latest `discourse_docker` changes to get the fix, but that is (or at least should be) standard procedure.

---

<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: [October 30, 2015, 9:35pm UTC](https://meta.discourse.org/t/issue-with-cloudflare-template/35113/6 "2015-10-30T21:35:11Z")

</div>

Standard procedure for what?

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [October 30, 2015, 9:36pm UTC](https://meta.discourse.org/t/issue-with-cloudflare-template/35113/7 "2015-10-30T21:36:11Z")

</div>

Standard procedure for anyone seeing a problem with their Discourse site on rebuild.

---

<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: [October 30, 2015, 9:54pm UTC](https://meta.discourse.org/t/issue-with-cloudflare-template/35113/8 "2015-10-30T21:54:05Z")

</div>

Do you have any way of telling how many installs use Cloudflare @codinghorror? Unless Cloudflare correct their data this issue is likely to impact every install which uses the template. I’d hate for others to experience the same outage and impact as we have today.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [October 30, 2015, 10:00pm UTC](https://meta.discourse.org/t/issue-with-cloudflare-template/35113/9 "2015-10-30T22:00:32Z")

</div>

It’s probably a fairly low number that use the CF template, as it is a very advanced user kind of thing.

---

<div class="post-metadata">

### Author: ![mpalmer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mpalmer/32/45740_2.png) [@mpalmer](https://meta.discourse.org/u/mpalmer)
#### Post date: [October 30, 2015, 10:03pm UTC](https://meta.discourse.org/t/issue-with-cloudflare-template/35113/10 "2015-10-30T22:03:00Z")

</div>

I’ve pushed an update which will fix the reported problem. A `git pull` should get it and a `./launcher rebuild` thereafter should produce a working config.

---

<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: [October 30, 2015, 10:04pm UTC](https://meta.discourse.org/t/issue-with-cloudflare-template/35113/11 "2015-10-30T22:04:38Z")

</div>

Will wait until we’re out of peak time before I test, so should be able to provide an update within 12 hours.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [November 1, 2015, 10:05pm UTC](https://meta.discourse.org/t/issue-with-cloudflare-template/35113/12 "2015-11-01T22:05:15Z")

</div>

This topic was automatically closed after 2 days. New replies are no longer allowed.
