CloudFront 分发返回错误 400

问题描述 投票:0回答:2

我有一个 CloudFront 发行版,其中设置了一些来源和相关行为。这实际上是我拥有的另一个类似(工作)发行版的重复。尝试通过备用域名访问服务时出现以下错误:

Bad request. We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.

根据此论坛和其他论坛上的其他帖子,这可能是由于以下两个问题之一造成的(请参阅403错误无法满足请求):

  1. 请求是通过 HTTP 发起的,但 CloudFront 分配配置为仅允许 HTTPS 请求。
  2. 请求的备用域名 (CNAME) 与 CloudFront 分配无关。

如果所有 CloudFront 源均配置为 http,并且这反映在对服务的实际调用中:

CNAME 也已更新,如下所示:

使用 Route53 测试 CNAME 记录不会产生错误:

我不知道还能在哪里寻找这个问题。与我已经运行的工作发行版相比,我找不到任何差异。

[编辑]

其实只是400错误。不是 403。

django amazon-web-services amazon-cloudfront
2个回答
1
投票

如果使用Django,可以修改配置ALLOWED_HOSTS,将请求地址添加到setting.py的ALLOWED_HOSTS中


0
投票

此问题不是 CloudFront 问题。端点指向的 Django 服务器上的配置不正确。很快就会删除这个问题。

© www.soinside.com 2019 - 2024. All rights reserved.