【问题标题】:Cloudfront Error: 502 ERROR The request could not be satisfiedCloudfront 错误:502 错误无法满足请求
【发布时间】:2020-12-28 12:47:02
【问题描述】:

我有一个 aws lightsail 实例。我已经创建了一个发行版并选择该实例作为我的来源。但是当我访问分发给我的默认域时:xxxxxxxxxx.cloudfront.net,我收到了这条消息:

502 ERROR
The request could not be satisfied.
CloudFront wasn't able to connect to the origin. 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.
Generated by cloudfront (CloudFront)

但是当我使用我的域名访问时,它工作正常,除了我收到x-cache: Miss from cloudfront的一些请求

在我的发行版中,我设置了您的发行版仅使用 HTTPS 从您的源中提取内容

在我的 WordPress 配置中,我已经安装了我的 SSL 证书并像这样配置 https:

define('WP_SITEURL', 'https://' . $_SERVER['HTTP_HOST'] . '/');
define('WP_HOME', 'https://' . $_SERVER['HTTP_HOST'] . '/');

我不知道我的网站是否有问题,您能帮帮我吗?

【问题讨论】:

  • 所以网站在 HTTPS 中工作而不使用 CloudFront?您使用了哪种 ssl 证书?
  • @Marcin 我使用 bncert-tool 生成证书 Let's Encrypt。当我在 chrome 浏览器中签入时,它显示 Issued by: Amazon
  • 这两个证书是不同的(Let's encrypt vs Amazon),因为它们用于不同的连接。 Let's encrypt cert在wordpress cloudfront之间使用,Amazon颁发的在cloudfront browser之间使用。
  • 面临 CloudFront 未到达负载均衡器的类似问题。你找到解决方案了吗?

标签: amazon-web-services amazon-cloudfront amazon-lightsail


【解决方案1】:

我只是不知道 发行版证书 内置 AWS Lightsail 有什么问题。 所以我去服务 AWS Cloudfront 并使用证书创建一个分配并将我的 Lightsail 的 DNS 配置到这个分配。一切正常。 参考:https://aws.amazon.com/blogs/compute/deploying-a-highly-available-wordpress-site-on-amazon-lightsail-part-1-implementing-a-highly-available-lightsail-database-with-wordpress/

【讨论】:

    猜你喜欢
    • 2022-08-12
    • 2018-03-03
    • 2014-01-06
    • 1970-01-01
    • 2021-05-12
    • 2021-11-23
    • 2023-03-30
    • 2018-12-29
    • 2020-09-24
    相关资源
    最近更新 更多