A Record (Cloudflare) pointing to EC2 instance not reachable
I have a subdomain that I want to point my EC2 instance. My instance is running a 3rd party software that requires HTTPS. I use Cloudflare for all my DNS routing and created an A Record to point to my EC2 IP address. I have no problems access it by IP, but fails when using the subdomain address (test.mydomain.com). Receiving an Error 520 message - Web server is returning an unknown error. I made sure that:
- EC2 security group port 80/443 is open for both 0.0.0.0/0 and ::/0
- Cloudflare SSL/TLS is set at Flexible
Not sure what I'm missing?
Hi.
Are you hosting a web server on EC2?
You should check the access log and error log of the web server. Then you should find the reason why Cloudflare responds with 520 error.
Another troubleshooting step: Edit the hosts file on your PC and add test.mydomain.com
as an entry with the IP address of your instance. Then you will be able to see what the instance is returning. You can also do this with tools like curl
and wget
by setting the Host
header in the request.
Relevant questions
Instance reachability check failed
asked a month agoLoad Balancer [NLB] - Listeners - Inconsistent
asked 3 months agoA Record (Cloudflare) pointing to EC2 instance not reachable
asked a month agoWhy was my EC2 Instance deleted from my account?
asked 2 years agoSubdomain redirection to EC2 instance
asked 2 years agoHow to point a new instance with a domain?
asked 25 days agoWhy was my EC2 Instance deleted from my account?
asked 2 years agoS3 bucket access on EC2 Instance using boto3
Accepted Answerasked 2 days agoNodeJS Beanstalk EC2 HTTPS Load Balancing
asked 2 months agoI can't reach EC2 instance even if all trafic is allowed
asked 2 months ago