【发布时间】:2019-11-11 06:32:46
【问题描述】:
我无法使用弹性 beanstalk、云端分发和路由 53 让我的 nodejs api 工作。我需要我的 api 在 SSL 后面运行,这就是我使用云端分发的原因。我有以下设置。
当我访问我的 api https://api.mydomain.com 时,我收到一个 504 并显示以下错误消息。
我的 api 运行的实际 url(成功地,使用 nodejs elastic 和 beanstalk)是http://dummy-env.n1eijsdai.eu-west-1.elasticbeanstalk.com。我只想将该网址与 SSL 一起屏蔽为 api.mydomain.com。
有什么我做错了吗/你能建议什么尝试吗?
查看 cloudfront 的配置,这看起来很奇怪,图片显示了以 S3 为前缀的设置,但此 api 不在 S3 上(至少直接),它由弹性 beanstalk 托管。
谢谢,
错误信息
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.
53 号公路
- name = api.mydomain.com
- 类型 = (A) 别名目标 = wqsdn31817
CloudFront 分配
域名 = wqsdn31817
origin = dummy-env.n1eijsdai.eu-west-1.elasticbeanstalk.com(如果我访问此网址,我会看到我的 api 正在运行)
SSL 证书 = api.mydomain.com
状态 = 已部署
源设置/源域名 = http://dummy-env.n1eijsdai.eu-west-1.elasticbeanstalk.com
源设置/源协议策略 = 仅 HTTPS
弹性豆茎
Nodejs api(使用 express)
在 beanstalk 环境 ID:e-1nasn4,URL:dummy-env.n1eijsdai.eu-west-1.elasticbeanstalk.com
【问题讨论】:
-
我遇到了类似的问题,但在 Lightsail 中使用 WordPress。一些请求成功,而另一些则失败(错误 504)。基本上,我使用 cloudfront 从 s3 为主要网站提供服务,而 /blog* 从 lightsail 实例提供服务。一开始还可以,但突然出现了问题。
标签: amazon-cloudfront amazon-elastic-beanstalk amazon-route53