# Error 500 | ERR\_CONNECTION\_CLOSED with Cloudflare

**URL:** https://meta.discourse.org/t/error-500-err-connection-closed-with-cloudflare/80422
**Category:** Support
**Created:** [February 12, 2018, 11:06pm UTC](https://meta.discourse.org/t/error-500-err-connection-closed-with-cloudflare/80422 "2018-02-12T23:06:14Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![barreeeiroo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/barreeeiroo/32/165264_2.png) [@barreeeiroo](https://meta.discourse.org/u/barreeeiroo)
#### Post date: [February 12, 2018, 11:06pm UTC](https://meta.discourse.org/t/error-500-err-connection-closed-with-cloudflare/80422/1 "2018-02-12T23:06:14Z")

</div>

I got a fresh VPS for my Discourse instance with these specs:

```plaintext
RAM: 2 GB
vCPU: 1 Core
SDD: 40 GB
OS: CentOS 7

```

The domain is passed through Cloudflare

* * *

Accessing through the configured domain gives **ERR\_CONNECTION\_CLOSED** error:

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

Accessing through IP directly gives **Error 500** :

 ![image](https://global.discourse-cdn.com/meta/original/3X/2/7/270ba1b5ffe4e47d0b912aa90e36e9c30aa5f169.png)

---

<div class="post-metadata">

### Author: ![barreeeiroo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/barreeeiroo/32/165264_2.png) [@barreeeiroo](https://meta.discourse.org/u/barreeeiroo)
#### Post date: [February 12, 2018, 11:19pm UTC](https://meta.discourse.org/t/error-500-err-connection-closed-with-cloudflare/80422/2 "2018-02-12T23:19:45Z")

</div>

First `production.log` showed the Redis Connection Refused error  
I installed and started the redis service manually

Now I get this:

```plaintext
Completed 500 Internal Server Error in 3900ms (ActiveRecord: 392.1ms)
ActionView::Template::Error (undefined local variable or method `render_google_analytics_code' for #<#<Class:0x00007fcce7ebc9c0>:0x00007fcce54693d0>
Did you mean? render_google_universal_analytics_code)
/var/www/discourse/plugins/discourse-branding/app/views/layouts/application.html.erb:115:in `_plugins_discourse_branding_app_views_layouts_application_html_erb__470741929770803549_70258981163020'

```

---

<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: [February 12, 2018, 11:19pm UTC](https://meta.discourse.org/t/error-500-err-connection-closed-with-cloudflare/80422/3 "2018-02-12T23:19:48Z")

</div>

Something is deeply wrong with your setup and/or DNS. ~~I don’t even recognize that other “Oops” message.~~ Turns out that is the 500 error page default text, so that is indeed Discourse at least.

---

<div class="post-metadata">

### Author: ![barreeeiroo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/barreeeiroo/32/165264_2.png) [@barreeeiroo](https://meta.discourse.org/u/barreeeiroo)
#### Post date: [February 12, 2018, 11:20pm UTC](https://meta.discourse.org/t/error-500-err-connection-closed-with-cloudflare/80422/4 "2018-02-12T23:20:45Z")

</div>

Check the error I posted right now:

 ![image](https://global.discourse-cdn.com/meta/original/3X/8/b/8b65985af027ab8f40d9211c9bb93c9c5831fb41.png)

---

<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: [February 12, 2018, 11:21pm UTC](https://meta.discourse.org/t/error-500-err-connection-closed-with-cloudflare/80422/5 "2018-02-12T23:21:22Z")

</div>

Your config is really, really broken. I would start over from scratch. Are you following our [official install](https://meta.discourse.org/t/142537?silent=true) docs, to the letter – and not deviating in any way on any step? Also don’t add any third party plugins.

---

<div class="post-metadata">

### Author: ![barreeeiroo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/barreeeiroo/32/165264_2.png) [@barreeeiroo](https://meta.discourse.org/u/barreeeiroo)
#### Post date: [February 12, 2018, 11:22pm UTC](https://meta.discourse.org/t/error-500-err-connection-closed-with-cloudflare/80422/6 "2018-02-12T23:22:16Z")

</div>

Yeah, I’ve done twice today, following the docker starter guide

And this is not the first time I deploy Discourse Forum System, I don’t know what’s happening  
I never had a problem like this

---

<div class="post-metadata">

### Author: ![barreeeiroo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/barreeeiroo/32/165264_2.png) [@barreeeiroo](https://meta.discourse.org/u/barreeeiroo)
#### Post date: [February 12, 2018, 11:24pm UTC](https://meta.discourse.org/t/error-500-err-connection-closed-with-cloudflare/80422/7 "2018-02-12T23:24:42Z")

</div>

> [@codinghorror](#):
>
> I would start over from scratch.

Okey, I’m going to reset the VPS and start again…

---

<div class="post-metadata">

### Author: ![barreeeiroo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/barreeeiroo/32/165264_2.png) [@barreeeiroo](https://meta.discourse.org/u/barreeeiroo)
#### Post date: [February 13, 2018, 12:08am UTC](https://meta.discourse.org/t/error-500-err-connection-closed-with-cloudflare/80422/8 "2018-02-13T00:08:43Z")

</div>

The Error 500 (_Oops_) is caused by a plugin, I’ll try to find which one  
Without any plugin it’s working perfectly, after importing my list doesn’t work. Probably it doesn’t happen on my normal community because they aren’t up to date

The ERR\_CONNECTION\_CLOSED is releated with Cloudflare, definitely  
I’ve set the “grey cloud” and it’s working now

---

<div class="post-metadata">

### Author: ![barreeeiroo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/barreeeiroo/32/165264_2.png) [@barreeeiroo](https://meta.discourse.org/u/barreeeiroo)
#### Post date: [February 13, 2018, 10:54am UTC](https://meta.discourse.org/t/error-500-err-connection-closed-with-cloudflare/80422/9 "2018-02-13T10:54:21Z")

</div>

> [@barreeeiroo](#):
>
> The ERR\_CONNECTION\_CLOSED is releated with Cloudflare, definitely

Any idea why this happens?  
I still get it 😕. And I need to provide access through the domain, as you can suppose

---

<div class="post-metadata">

### Author: ![barreeeiroo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/barreeeiroo/32/165264_2.png) [@barreeeiroo](https://meta.discourse.org/u/barreeeiroo)
#### Post date: [February 13, 2018, 1:10pm UTC](https://meta.discourse.org/t/error-500-err-connection-closed-with-cloudflare/80422/10 "2018-02-13T13:10:55Z")

</div>

I’ve found the reason for the ERR\_CONNECTION\_CLOSED:

Taken from Cloudflare:

> **You’re accessing a subdomain not covered by the Cloudflare-issued SSL certificate**  
> Cloudflare-issued SSL certificates cover the root-level domain (eg- [example.com](http://example.com)) and one level of subdomains (eg- \*.example.com). If you’re attempting to access a second level of subdomains (eg- _._.example.com) through Cloudflare using the Cloudflare-issued certificate, a HTTP 403 error will be seen in the browser as these host names are not present on the certificate. If you need to have SSL working for these type of host names you would either need to purchase a Dedicated Certificate with Custom Hostnames through Cloudflare, purchase your own SSL cert and upload it to us as a Custom SSL Certificate or grey-cloud this DNS record so the traffic goes directly to your origin server.

I was using this subdomain: `xn--nxa.community.makeroid.io` and as you can see it has a double subdomain, which isn’t supported by Cloudflare Free plan  
In order to support those subdomains it’s required a paid plan

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [June 8, 2024, 12:43pm UTC](https://meta.discourse.org/t/error-500-err-connection-closed-with-cloudflare/80422/11 "2024-06-08T12:43:30Z")

</div>

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