Error 521 on AWS

Trying to setup Cloudflare to work with my domain and EC2 instance on Amazon, but getting an error 521 in return.

I’ve replaced the DNS in my domain registrar as well as on Amazon’s Route53 with Cloudflare’s, and set the instance’s Elastic IP on Cloudflare’s config.

The server is okay, accessing through IP works normally.

What am I missing?

Here’s the Ray ID if it helps: 4eca79de6a4567f5

Usual question, do you have an HTTPS certificate configured on your server?

Whats the domain?

What about my HTTPS question?

is there an additional step to be taken to enable https besides editing rules on my instance’s security group?

also, the IP ends on 122

Can you access your site - via HTTPS - if Cloudflare is paused?
Whether there are additional steps to be taken is a question for Amazon I am afraid.

Would you feel comfortable sharing the IP address here?

As expected, HTTPS is the very issue. Your server simply does not respond on port 443 at all. You need to enable HTTPS in your webserver and make sure you have a valid certificate.

that was it, yes
I enabled traffic on my security group, but I had yet to install the required module for my instance to be able to handle HTTPS

sudo yum install -y mod24_ssl

I’m still learning a lot so I apologize if the issue was dumb, and thank you for your replies!

One thing to keep in mind, there still isnt a valid certificate, only a self-signed one for different hostnames. In this way you cant use the secure “Full strict” mode on Cloudflare but only the less secure “Full”.

You should best configure such a valid certificate. That can be any, paid, free, or a free Cloudflare origin certificate. The latter will only work in a Cloudflare context though (only trusted by Cloudflare).