没有负载均衡器的EC2实例上的AWS SSL-NodeJS [英] AWS SSL on EC2 instance without Load Balancer - NodeJS

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

问题描述

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

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 balancer route53 一起使用,但是我不想再为ELB支付$ 18/mo的费用,尤其是当我只有一台服务器正在运行.

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.

-手动执行此操作,将其装入服务器并按照

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

-或在您的应用程序中包含必要的文件(我相信这仅适用于弹性beantalk吗?),这将自动覆盖nginx配置文件,如

-- 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆