具有来自 certbot 的 SSL 证书的同一个 Digital Ocean Droplet 中的多个节点实例

问题描述

我一直在我的 node.js 服务器中使用 SSL 证书。它当前正在端口 80 上运行端口 5000 的实例。现在,我还想在同一个 droplet 中添加另一个 node.js 服务器。它托管在数字海洋中。他们也将共享同一个 MongoDB 数据库。但是,我无法访问新实例。每次访问基本 URL 时,它只运行前一个实例。即使这个实例在 pm2 中实时运行,我也无法访问它。我也添加了这些代码片段。如何访问在端口 5001 上运行的下一个实例?

location / {
        # First attempt to serve request as file,then
        # as directory,then fall back to displaying a 404.
        proxy_pass http://localhost:5000; #this part is working
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
}

location /getter {
        proxy_pass http://localhost:5001; #trying to run new instance on this port
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...