关于亚马逊网络服务:尝试通过Cloudfront在EC2实例上设置SSL时出现502错误

Getting 502 error when trying to set up SSL on EC2 instance via Cloudfront

我正在尝试使用Cloudfront和Route 53在安装了Wordpress的EC2实例上设置SSL证书,但是当我转到该URL时,在浏览器中出现502错误。我没有使用ELB,因为我预计流量不会很高(至少有一段时间)。任何人都知道问题是什么吗?

这是我遇到的错误:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Request URL:https://react.edbiden.com/
Request Method:GET
Status Code:502
Remote Address:54.230.11.194:443
Referrer Policy:no-referrer-when-downgrade
Response Headers
content-length:587
content-type:text/html
date:Sun, 13 Aug 2017 10:45:32 GMT
server:CloudFront
status:502
via:1.1 d10e0115903b50001036753d910516ef.cloudfront.net (CloudFront)
x-amz-cf-id:YWp5HN-1zbO56PxkmH_TIBYFtQ4sO1LnvmYk4wjnrTfuXKP0RHLxnQ==
x-cache:Error from cloudfront

在Route 53中,我获得了IP4和IP6的A记录:

1
2
3
Alias: Yes
Alias Target: d2dzwf20h9q46z.cloudfront.net.
Routing: Simple

在Cloudfront中:
enter http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https-cloudfront-to-custom-origin.html

您可以尝试在实例中使用"让我们加密证书"。


将原始协议策略更改为"仅HTTP"。
否则,CloudFront会尝试通过HTTPS连接到EC2实例,这可能会失败。