Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Elastic beanstalk请求上的Node.js是HTTPS,而express是HTTP。这安全吗?_Node.js_Amazon Web Services_Express_Amazon Elastic Beanstalk - Fatal编程技术网

Elastic beanstalk请求上的Node.js是HTTPS,而express是HTTP。这安全吗?

Elastic beanstalk请求上的Node.js是HTTPS,而express是HTTP。这安全吗?,node.js,amazon-web-services,express,amazon-elastic-beanstalk,Node.js,Amazon Web Services,Express,Amazon Elastic Beanstalk,我有一个node express项目,它托管在AWS elastic beanstalk上。当我检查开发工具中的网络选项卡时,我的请求是HTTPS。但是,我的node express应用程序的代码是在HTTP中提供的。我是否需要将“http”模块更改为“https”? 如果我这样做了,那么我是否必须从AWS的某个地方提供一些密钥 const http = require('http'); const app = require('./app'); const normalizePort = v

我有一个node express项目,它托管在AWS elastic beanstalk上。当我检查开发工具中的网络选项卡时,我的请求是HTTPS。但是,我的node express应用程序的代码是在HTTP中提供的。我是否需要将“http”模块更改为“https”? 如果我这样做了,那么我是否必须从AWS的某个地方提供一些密钥

const http = require('http');
const app = require('./app');

const normalizePort = val => {
  var port = parseInt(val, 10);

  if (isNaN(port)) {
    // named pipe
    return val;
  }

  if (port >= 0) {
    // port number
    return port;
  }

  return false;
};


const onListening = () => {
  const addr = server.address();
  const bind = typeof addr === "string" ? "pipe " + addr : "port " + port;
  //debug("Listening on " + bind);
};

const port = normalizePort(process.env.PORT || "8081");
app.set("port", port);

const server = http.createServer(app);
server.on("error", onError);
server.on("listening", onListening);
server.listen(port);

您不必将其更改为HTTPS

当您使用AWS EB时,您会在每台用于反向代理到应用程序的机器上获得负载平衡器(ELB)和证书+nginx

AWS可帮助您免费将连接固定到负载平衡器

如果你想增加一个额外的安全层,这取决于你

对于大多数用例,除非您真的处理非常敏感的数据(医疗、工业),否则第一层已经足够好了,并且将保持与ELB的所有连接安全且不受影响

如果您确实想添加额外的安全层,您可以使用“let's encrypt”创建一个证书,将密钥保存在您的计算机上,并使用https启动服务器并配置密钥

看看:


它使用的是certbot(让我们加密cli…

您不必将其更改为HTTPS

当您使用AWS EB时,您会在每台用于反向代理到应用程序的机器上获得负载平衡器(ELB)和证书+nginx

AWS可帮助您免费将连接固定到负载平衡器

如果你想增加一个额外的安全层,这取决于你

对于大多数用例,除非您真的处理非常敏感的数据(医疗、工业),否则第一层已经足够好了,并且将保持与ELB的所有连接安全且不受影响

如果您确实想添加额外的安全层,您可以使用“let's encrypt”创建一个证书,将密钥保存在您的计算机上,并使用https启动服务器并配置密钥

看看:

它正在使用certbot(让我们加密cli…)