我使用nginx在centos中托管了重新思考的数据库,并将端口8080代理到一个域名。在本地pc上,如何将应用程序连接到服务器?
发布于 2021-04-14 19:00:06
您需要在您的centos服务器上打开28015端口,然后通过此连接字符串连接到您的centos服务器上的rethinkdb监听28015端口
r = require('rethinkdb')
r.connect({ host: 'centos.example.org', port: 28015 }, function(err, conn) {...});其中centos.example.org是服务器的主机名/ip。
值得注意的是,您应该在防火墙中将您的IP列入白名单(因此,只允许来自您的家庭IP的连接),或者在rethinkdb服务器上安装授权和tls证书。
这些文档可以帮助您-
https://stackoverflow.com/questions/67088799
复制相似问题