我在通过错误的网络路由流量时遇到了一些配置问题。
我有:
- RavenDB(4.2 版)安装在一台服务器上
- 安装在另一台服务器上的网站(安装在 IIS 上)
两台服务器都在同一个网络上。
我们面临的问题是 db 和 web 之间的所有流量都通过 Internet/外部网络运行,而不是通过内部网络。这显然是一个问题,并且希望流量在内部网络上运行。
不幸的是,我们还没有弄清楚如何正确配置它。
RavenDB 设置.json:
{
"DataDir": "RavenData",
"License.Eula.Accepted": true,
"Security.Certificate.LetsEncrypt.Email": "some@email.com",
"Setup.Mode": "LetsEncrypt",
"Security.Certificate.Path": "certificate.pfx",
"ServerUrl": "https://0.0.0.0:8080",
"ServerUrl.Tcp": "tcp://0.0.0.0:38888",
"ExternalIp": "109.0.0.0",
"PublicServerUrl": "https://public_domain:8080",
"PublicServerUrl.Tcp": "tcp://public_domain:38888"
}
(上面的一些数据是模糊的。上面的“ExternalIp”设置是隐藏的,但设置为与指向PublicServerUrl-domain的相同的外部IP)
网站数据库设置:
<add key="Raven.Url" value="https://public_domain:8080" />
<add key="Raven.File.Url" value="https://public_domain:8080" />
我试过的:
- 将 settings.json 中的 ServerUrl 值更改为 RavenDB 的内部 IP。
- 将 db 应用程序设置 (Raven.Url) 更改为内部 IP。这导致异常:
Raven.Client.Exceptions.Security.CertificateNameMismatchException: You are trying to contact host *internal ip inserted here* but the hostname must match one of the CN or SAN properties of the server certificate
如何强制流量通过内部 IP/网络而不是外部 IP/Internet?