Cloudflare DNS setup with AWS ELB and Instances

Hi,

I am not an expert with DNS and thought perhaps someone could help me figure this out.

I have a site where the all the domains are handled at CloudFlare (CF).

There is now a backend on AWS that has a load balancer (ELB) which forwards traffic via HTTPS to two instances in the target group.

I can add a CNAME to point to my load balancer which works fine:

some-subdomain-elb.example-com -> AWS load balancer DNS

The problem is that the instances are not responding to traffic. Each instance is running nginx in the same exact configuration. They have been set up to only respond to HTTPS and have been equipped with the SSL certificates from CF.

I’ve also assigned them a $server_name in the config which is subdomain.example-com

The only way I can get the machines to also respond if I add additional A records in the form of subdomain.example-com pointing to the each of the ec2 provided IP address.

Is there a way to route traffic directly to the load balancer and configure instances using CF provided SSL certificates that don’t require additional A records set in CF?

Please advise
Thanks

  • J

Nevermind! Figured it out.