本文介绍了没有负载均衡器的 EC2 实例上的 AWS SSL - NodeJS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在没有负载均衡器的情况下运行EC2实例,监听端口443?我现在正在我的 Node.JS 应用程序中尝试,但是当我使用 https:// 调用页面时它不起作用.但是,如果我将其设置为 port 80http:// 一切正常.

Is it possible to have an EC2 instance running, listening on port 443, without a load balancer? I'm trying right now in my Node.JS app but it doesn't work when I call the page using https://. However, if I set it to port 80 everything works fine with http://.

我之前使用 load balancerroute53 让它工作,但我不想再为 ELB 支付 18 美元/月,尤其是当我只有一台服务器正在运行.

I had it working earlier with a load balancer and route53, but I don't want to pay $18/mo for an ELB anymore, especially when I only have one server running.

感谢您的帮助

推荐答案

你说得对,如果只是一个实例并且你觉得你不需要为流量的大幅增加做好准备,你不应该必须为 ELB 付费.

You're right, if it's only the one instance and you feel like you don't need to be prepared for large increases in traffic, you shouldn't have to pay for an ELB.

从高层次的角度来看,您必须完成以下步骤:

From a high-level standpoint you'll have to go through the following steps:

  1. 安装一个 nginx 服务器来为您的 NodeJS 应用程序提供服务.
  2. 在 nginx 服务器上安装您的 SSL 证书.

  1. Install an nginx server to serve your NodeJS application.
  2. Install your SSL certificates on the nginx server.

-- 手动执行此操作,通过 ssh 连接到服务器并按照 此处.

-- Either do this manually, ssh'ing into the server and installing the certs as described here.

-- 或者在您的应用程序中包含必要的文件(我相信这仅适用于弹性 beantalk?),它将按照 这里.

-- OR include the necessary files in your application (I believe this only works for elastic beanstalk?) which will overwrite the nginx configuration files automatically as described here.

这篇关于没有负载均衡器的 EC2 实例上的 AWS SSL - NodeJS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 23:36