Subdomain not working AWS EC2


I have 2 websites hosted on AWS. One website resolves perfectly fine but the subdomain is giving me gray hair. I have added the subdomain under my DNS Records in Cloudflare and pointed the subdomain to the second AWS IP Address. When I open the subdomain is shows me Error 521.
Opening the IP Address of the said subdomain AWS instance is fine.

Please help.


Do you have a valid SSL cert in your EC2 instance? Is your Cloudflare SSL encryption mode set to Full (strict)?

no it is a clean/fresh ubuntu server with only apache installed. Cloudflare SSL is set to FULL (not Full/Strict)

Then I believe it does not come with SSL cert. Get one from Cloudflare (Origin cert) and install it in the server, then switch to Full (strict).

I just tested Full/Strict but then the main domain does not work

That means your main domain does not have a valid SSL certificate as well.


The main domain fully resolves in https since last year that way

Hi I am in the process of installing the Cloudflare Full/Strict onto both servers. Will keep you updated.

Hi ok it is working now after using the Cloudflare Origin Certificate on all instances. Thanks

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.