简体   繁体   English

EC2实例上的HTTPS

[英]HTTPS on a EC2 instance

I have an EC2 instance on Amazon (AWS). 我在Amazon(AWS)上有一个EC2实例。 The instance is behind a ELB (Elastic Load Balancer). 该实例位于ELB(弹性负载平衡器)的后面。 I want to allow HTTPS connections to reach the EC2 instance. 我想允许HTTPS连接到达EC2实例。

Is it necessary to have the load balancer configured for HTTPS, ie, to check the certificates etc, or can this just be done traditionally within the EC2 instance and virtual host SSL configuration ? 是否有必要为HTTPS配置负载均衡器,即检查证书等,还是可以按照传统的方式在EC2实例和虚拟主机SSL配置中完成?

The reason I'm asking is because I have allowed traffic via ELB -> EC2 for port 80 and 443, but only port 80 reaches the instance. 我问的原因是因为我已经允许通过ELB-> EC2的端口80和443进行通信,但是只有端口80才能到达实例。

EDIT 编辑

Nmap scan report for localhost (127.0.0.1)
Host is up (0.00021s latency).
Not shown: 996 closed ports
PORT     STATE SERVICE
22/tcp   open  ssh
80/tcp   open  http
443/tcp  open  https
3306/tcp open  mysql

EDIT 2 编辑2

Here is my other stack overflow questions explaining the bigger problem I have, hence why I opened this question. 这是我的其他堆栈溢出问题,解释了我遇到的更大问题,因此解释了为什么打开这个问题。 HTTPS only works on localhost HTTPS仅适用于本地主机

Check whether any application is running on port 443. 检查端口443上是否正在运行任何应用程序。

Use this command to check: 使用此命令检查:

nmap -sT -O localhost

EDIT 编辑

Add the certificate files on the server and then upload them to IAM using the command: 将证书文件添加到服务器上,然后使用以下命令将其上传到IAM:

aws iam upload-server-certificate --server-certificate-name my-server-cert --certificate-body file://my-certificate.pem --private-key file://my-private-key.pem --certificate-chain file://my-certificate-chain.pem

For more info check this: 有关更多信息,请检查以下内容:

http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/ssl-server-cert.html http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/ssl-server-cert.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM