Backup domain name: cloudflare killed my forum

OK. I have cloudflare as a proxy in front of discourse. Cloudflare is currently down and the problem I have is I cannot even log onto cloudflare to re-configure the DNS to bypass their servers.

So currently, I cannot access discourse via its normal domain name.

I was wondering if it is possible to configure a backup domain name which can be used which I would then bypass cloudflare and have discourse respond with this alternative name i.e. not re-write to default.

e.g. if my normal forum is myforum.com, then i setup backup.myforum.com as an alternative.

I have no idea why, but when I woke up, all websites with CF protection shields were inaccessible.

AFAIK, You have to wait for Cloudflare to come back online.

1 Like

If you have a Cloudflare API token available and are not afraid of a command line, you can turn off the proxy like this:

First grab the zone ID via:

curl -X GET "https://api.cloudflare.com/client/v4/zones" -H "Authorization: Bearer $API_TOKEN" -H "Content-Type: application/json" | jq -r '.result[] | "\(.id) \(.name)"'

And a list of DNS records using:

curl -X GET "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records" -H "Authorization: Bearer $API_TOKEN" -H "Content-Type: application/json"

Each DNS record will have an ID associated. Finally patch the relevant records:

curl -X PATCH "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records/$RECORD_ID" -H "Authorization: Bearer $API_TOKEN" -H "Content-Type: application/json" --data '{"proxied":false}'

3 Likes

Hi Richard.

Thanks. Yes, the API could be a solution (assuming it is still working) for changing the DNS.

My other question was on the discourse side: is it possible to run a forum that presents multiple different domain names?

It is. No need to change the DNS, you just need to turn off the proxy.

Sure. How are people going to know where to go?

Unfortunately, it was more involved as the site was configured to use Cloudflare’s internal SSL certficates and so new SSL certs had to be set up etc. etc.

Ironic that over-reliance on cloudflare, which is intended to protect websites and keep them up is also a weakness that can cause them to be down.

Sure. How are people going to know where to go?

how do you give the forum 2 different domain names? e.g. a.forum.com and b.forum.com without requests to b.forum.com being re-written to a.forum.com?

See Set up Let’s Encrypt with multiple domains / redirects - #172 by featheredtoast

you might have to tweak Nginx to avoid the redirect, I don’t know the details of the Docker setup.