如何解决具有来自 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(将#修改为@)