I'm not able to get my nodejs api working using elastic beanstalk, cloudfront distribution and route 53. I need my api to be running behind an SSL, this is why I'm using cloudfront distribution. I have the following setup.
When I visit my api https://api.mydomain.com I get a 504 with the error message below.
The actual url my api is running on (successfully, using nodejs elastic with beanstalk) is http://dummy-env.n1eijsdai.eu-west-1.elasticbeanstalk.com. I just want to mask that url as api.mydomain.com together with an SSL.
Is there something I've got wrong/ can you suggest anything to try?
Looking through the configuration for cloudfront this looks strange, the picture shows the setting prefixed with S3 but this api is not on an S3 (at least directly) it is hosted by elastic beanstalk.
Thanks,
Error message
504 ERROR
The request could not be satisfied.
CloudFront attempted to establish a connection with the origin, but either the attempt failed or the origin closed the connection.
If you received this error while trying to use an app or access a website, please contact the provider or website owner for assistance.
Route 53
- name = api.mydomain.com
- Type = (A) Alias target = wqsdn31817
CloudFront Distributions
domain name = wqsdn31817
origin = dummy-env.n1eijsdai.eu-west-1.elasticbeanstalk.com (if I visit this url I see my api running)
SSL certificate = api.mydomain.com
status = deployed
Origin Settings/ Origin Domain Name = http://dummy-env.n1eijsdai.eu-west-1.elasticbeanstalk.com
Origin Settings/ Origin Protocol Policy = HTTPS Only
Elastic Beanstalk
Nodejs api (using express)
In beanstalk Environment ID: e-1nasn4, URL: dummy-env.n1eijsdai.eu-west-1.elasticbeanstalk.com
