是否可以在没有负载均衡器的情况下使用带 SSL (HTTPS) 的 Amazon Elastic Beanstalk?
Is possible to use Amazon Elastic Beanstalk with SSL (HTTPS) without a Load Balancer?
从现在开始,我的应用程序需要安全连接 (HTTPS)。我确认大多数用于在 Amazon Web Services Elastic Beanstalk 上添加安全连接 (https) 的教程都使用 Elastic Load Balancer 作为隧道。
在我的例子中,我是 运行 单个实例,实际上我不需要负载均衡器。如何在没有 Elastic Load Balancer 的情况下向我的实例添加安全连接?这可能吗?
我正在使用 64 位亚马逊 Linux 2017.03 v2.4.4 运行 PHP 7.0 Elastic Beanstalk。
这绝对有可能。这是来自 AWS 使用 Apache 的 example。
基本步骤是:
编辑
您也可以为此使用 CloudFront。这也将允许您使用 Certification Manager 的认证。请记住在 N-Virginia 区域创建它们。
警告
CloudFront
和 Elastic Beanstalk
之间的数据仍将通过 http
交换,因为您的容器不支持 https
。
您还需要更改以下设置:
https
可以在没有负载平衡器的情况下使用代理服务器进行配置,这是您的情况(php 与 Amazon Linux 2+)应该是 nginx
。我创建了一个 gist
for configuring https
in EBS and it fits in Free Tier but for java. You can see more examples here but first find what proxy server you are using(apache or nginx) as the configuration varies accordingly. For more info see Reverse proxy configuration
目前 aws 文档适用于旧版亚马逊 linux,因此它们无法使用。
这是你应该做的:
- 在安全组中开放端口 443
- 在服务器上添加您的证书和私钥文件。您可以为此使用 .ebextensions。
- 在/etc/nginx/conf.d 中的服务器上创建nginx conf 文件,并使其监听端口443 并使用您的证书文件加密连接。
在 proxy_pass 添加您的应用 (127.0.0.1:your_port)
您可以使用 ssh 创建 nginx conf 文件或在您的应用程序的根文件夹中添加 .platform/nginx/conf.d 并在其中添加您的配置文件。
如果您想要更详细的解释,请看这里:
https://youtu.be/zTXS3a67-9c
从现在开始,我的应用程序需要安全连接 (HTTPS)。我确认大多数用于在 Amazon Web Services Elastic Beanstalk 上添加安全连接 (https) 的教程都使用 Elastic Load Balancer 作为隧道。
在我的例子中,我是 运行 单个实例,实际上我不需要负载均衡器。如何在没有 Elastic Load Balancer 的情况下向我的实例添加安全连接?这可能吗?
我正在使用 64 位亚马逊 Linux 2017.03 v2.4.4 运行 PHP 7.0 Elastic Beanstalk。
这绝对有可能。这是来自 AWS 使用 Apache 的 example。
基本步骤是:
编辑
您也可以为此使用 CloudFront。这也将允许您使用 Certification Manager 的认证。请记住在 N-Virginia 区域创建它们。
警告
CloudFront
和 Elastic Beanstalk
之间的数据仍将通过 http
交换,因为您的容器不支持 https
。
您还需要更改以下设置:
https
可以在没有负载平衡器的情况下使用代理服务器进行配置,这是您的情况(php 与 Amazon Linux 2+)应该是 nginx
。我创建了一个 gist
for configuring https
in EBS and it fits in Free Tier but for java. You can see more examples here but first find what proxy server you are using(apache or nginx) as the configuration varies accordingly. For more info see Reverse proxy configuration
目前 aws 文档适用于旧版亚马逊 linux,因此它们无法使用。
这是你应该做的:
- 在安全组中开放端口 443
- 在服务器上添加您的证书和私钥文件。您可以为此使用 .ebextensions。
- 在/etc/nginx/conf.d 中的服务器上创建nginx conf 文件,并使其监听端口443 并使用您的证书文件加密连接。
在 proxy_pass 添加您的应用 (127.0.0.1:your_port)
您可以使用 ssh 创建 nginx conf 文件或在您的应用程序的根文件夹中添加 .platform/nginx/conf.d 并在其中添加您的配置文件。
如果您想要更详细的解释,请看这里: https://youtu.be/zTXS3a67-9c