【问题标题】:Can't configure AWS Lightsail distribution - status 502无法配置 AWS Lightsail 分发 - 状态 502
【发布时间】:2022-01-05 07:38:14
【问题描述】:

我已经在 AWS 中设置了 Lightsail/Bitnami wordpress 实例。分配一个静态 IP 并使用我的 xyz.com 域在 cloudflare DNS 中设置它。运行 bncert-tool 以针对此实例验证域名。

后来我决定将 CDN 添加到此实例中,因为 woocommerce 正在减慢它的速度。开始分发。选择用于缓存的 wordpress 配置并选择“仅 HTTPS”。 (这是出错的地方)。分发开始。当我单击分发 abcdef.cloudflare.com 的默认域时,我只会收到错误消息:

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.

我尝试使用下面的重定向设置 wp-config 文件并重新启动 apache [sudo /opt/bitnami/ctlscript.sh restart apache] 但没有做任何事情。

if (isset($_SERVER['HTTP_CLOUDFRONT_FORWARDED_PROTO'])
&& $_SERVER['HTTP_CLOUDFRONT_FORWARDED_PROTO'] === 'https') {
$_SERVER['HTTPS'] = 'on';
}

之前我尝试在 cloudflare 中创建 CNAME 条目来验证分发所有权。使用分发页面的工具创建自定义凭据以验证 xyz.com,然后将 DNS 中的 xyz.com 域指向具有 CNAME 条目的分发的默认域。

502 错误和其他随机 gremlin 错误,例如当我通过反复试验修改设置时,出现太多重定向错误等。

我应该怎么做 - 我似乎错过了帮助文件文档。请帮忙。

【问题讨论】:

    标签: wordpress ssl-certificate cdn bitnami amazon-lightsail


    【解决方案1】:

    很明显,我没有将 SSL 回滚/重置为自我认证的,所以这就是问题所在。采取了简单的方法 - 回滚到以前的快照并重新开始。

    【讨论】:

    • 我遇到了同样的问题,但我不明白你的解决方案,我觉得我错过了一些基本的东西。我需要 CDN 和源上的 SSL 证书还是只需要一个或另一个?
    猜你喜欢
    • 2020-12-04
    • 2013-10-03
    • 2018-09-23
    • 2022-01-01
    • 2016-09-16
    • 2021-07-25
    • 2019-05-04
    • 2018-04-05
    • 2019-05-28
    相关资源
    最近更新 更多