2 domains 1 origin certificate, howto?

I have 2 domains, lets say A and B both on Cloudflare free tier. I’ve set up A to redirect to B via a CNAME record.

B was set up in a way that the connection between Cloudflare and the origin server was encrypted via Cloudflare’s origin certificates. The problem is Cloudflare only allows me to generate an origin certificate for B and its subdomains so when I try to view the site from domain A I’m getting an error 521.

How can I solve this?


A CNAME is not a redirect and a 521 is not a certificate error but indicates that your server is down.

Please post the actual URLs.

You can always have your origin servers generate their own certs for free through Letsencrypt, e.g. with acme.sh using ‘stateless’ mode, and upon success, reload the webserver configuration with sudo. This has two advantages:

  1. You don’t have to mess with CF’s origin certificates.
  2. If and when you need to bypass CF, everything will just continue to work for your users.

Of course, maybe CF’s origin is simpler for you; I’m just making a suggestion based on what works for me :slight_smile:

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