The user encountered an Error 500 and ERR_CONNECTION_CLOSED when accessing their Discourse instance via Cloudflare. Initial issues included a Redis connection error and a template error due to a plugin (render_google_analytics_code), which was resolved by removing plugins. The ERR_CONNECTION_CLOSED was traced to Cloudflare’s SSL certificate limitations: the subdomain xn--nxa.community.makeroid.io uses a second-level subdomain not supported under Cloudflare’s free plan barreeeiroo. The solution involved grey-clouding the DNS record to bypass Cloudflare’s SSL restrictions, allowing direct access to the origin server. The user confirmed the site works without plugins and resolved the issue by adjusting DNS settings barreeeiroo.
First production.log showed the Redis Connection Refused error
I installed and started the redis service manually
Now I get this:
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'
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.
Your config is really, really broken. I would start over from scratch. Are you following our official install docs, to the letter – and not deviating in any way on any step? Also don’t add any third party plugins.
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
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) 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