CloudFront integration with Elastic Beanstalk not working

0

Hi,

I have a RoR application successfully deployed to AWS ElasticBeanstalk. This app is being asked for data from a front-end deployed in Netlify which uses the https protocol.

Not so long ago I had an SSL certificate issue when I tried to access the was EB application, which I solved by adding an SSL Certificate to the Load Balancer associated with the EC2 instance. Ever since I fixed the certificate issue for https traffic, I have been dealing with a CORS error, which from what I have been reading has to do with some request headers not present.

As a first step, I went to my RoR code and made sure the cors configuration was accurate. Then, I tried to add those headers directly to the load balancer, which I later found to be impossible. Some people suggested Mounting CloudFront on top of the balancer and adding the headers to that CouldFront distribution so that is what I am currently working on. Unfortunately I keep running into some issues. One in particular has been difficult to solve. When I copy the CloudFront distribution domain name, and try it in the browser I keep getting this error: : xn--awseb-awseb-4sam6k5ro0wu-2125335482-i31v.us-west-2.elb.amazonaws.com refused to connect.”

The Bold section on that error represents my load balancer’s DNS name, which makes me think that CloudFront is effectively sending the traffic down to the load balancer, but for some reason it stops there. I should point out that without adding CloudFront, every time I test my app with Postman, my load balancer effectively delivers the content I requested.

Anyways, I am trying to add CloudFront to my infrastructure so that I can add request headers and avoid getting the CORS error when I request data from and https origin and I was wondering if there was anyone willing to offer advice or even better, meet via zoom or any other video chat platform and look at my setup for a brief moment.

Please feel free to look me up on linkedIn at:

https://www.linkedin.com/in/tyler-charawell-75a811132/ Tyler Charawell | LinkedIn

Or

https://www.linkedin.com/in/albertogonzalez1091/ Alberto González Sáenz | LinkedIn

Thank you!

  • It sounds like you are using CloudFront in front of Beanstalk; do you need the traffic from CloudFront to the LBaaS/Beanstalk to be encrypted / SSL ? ( Traffic from the client to CloudFront will be https ) : It's easier to configure if not.

  • Yes, the traffic from the client has to be https. Http to http works just fine for us right now and was much easier to configure haha.

No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions