【问题标题】:Run nodejs app through HTTPS通过 HTTPS 运行 nodejs 应用程序
【发布时间】:2018-11-08 11:51:00
【问题描述】:

我有一个通过运行 node osjs run --hostname=dc-619670cb94e6.vtxfactory.org --port=4100 在 SSH 上设置的节点应用程序。

它从 http://dc-619670cb94e6.vtxfactory.org:4100/ 开始没有问题,但我想通过 HTTPS https://dc-619670cb94e6.vtxfactory.org:4100/ 提供它,我收到错误 ERR_CONNECTION_CLOSED

如果我使用该端口,我无法通过 https 访问它,但https://dc-619670cb94e6.vtxfactory.org/ 可以访问。

如何通过 Https 服务于 4100 端口?

谢谢。

【问题讨论】:

  • 你试过server.listen(4100)吗?
  • 喜欢这个? <VirtualHost *:80> ServerName dc-619670cb94e6.vtxfactory.org ProxyPass / http://https://dc-619670cb94e6.vtxfactory.org:4100/ Listen 4100 </VirtualHost>

标签: node.js ssl https port os.js


【解决方案1】:

这是 OS.js 的实现细节。他们的文档建议为服务器设置反向代理。这样做可以让您更好地控制 SSL 和端口,如您所愿

https://manual.os-js.org/installation/

【讨论】:

  • 嗨,是的,我一直在指导该链接,但我对如何将反向代理应用于我的情况感到有些迷茫:<VirtualHost *:80> ServerName dc-619670cb94e6.vtxfactory.org ProxyPass / http://https://dc-619670cb94e6.vtxfactory.org:4100/ </VirtualHost> 我应该像这样将它添加到我的 httpd.xml 中吗? conf文件以通过https启用它?
猜你喜欢
  • 2021-09-25
  • 1970-01-01
  • 2016-02-06
  • 1970-01-01
  • 1970-01-01
  • 2021-02-04
  • 1970-01-01
  • 2021-01-16
  • 2017-11-07
相关资源
最近更新 更多