1
votes

I've got domain1.com on cloudflare with SSL enabled and domain2.com is the main nginx server hosted on AWS with a valid SSL certificate all setup ok - (I can access https://domain2.com with no security warning)

I've setup forwarding on cloudflare so domain1 will do a 301 redirect to https://domain2.com

This is fine if I access domain1 over HTTP,

But when I access https://domain1.com - I get the Security warning.

1

1 Answers

0
votes

This ain't possible with your current config because your browser requests the certificate for domain1 but is given the cert for domain2, thus throwing an error.

The only safe thing you could do is to buy a so-called SAN certificate, I'm afraid.

Here's some more detailed info: http://www.jasonsamuel.com/2011/03/07/how-to-properly-use-ssl-redirects-without-getting-certificate-error-messages/