【发布时间】:2018-02-07 09:16:51
【问题描述】:
我有一组 Nginx 服务作为单个地址的负载平衡器,比如说www.example.com。我想要一个单独针对这些机器的测试套件,而不是像直接访问地址那样通过 DNS 负载平衡。
当我尝试在 curl 中做类似的事情时,我得到:
$ curl -H "Host: www.example.com" -v https://10.10.10.10/
* Trying 10.10.10.10...
* Connected to 10.10.10.10 (10.10.10.10) port 443 (#0)
* found 173 certificates in /etc/ssl/certs/ca-certificates.crt
* found 697 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_256_GCM_SHA384
* server certificate verification OK
* server certificate status verification SKIPPED
* SSL: certificate subject name (www.example.com) does not match target host name '10.10.10.10'
* Closing connection 0
curl: (51) SSL: certificate subject name (www.example.com) does not match target host name '10.10.10.10'
我知道10.10.10.10 不是同名,但我想指示该工具相信它是(因为我知道它是,这些都是服务于同一个域的负载平衡器)。
有什么方法可以做到不涉及处理 DNS 解析?
【问题讨论】:
-
主机文件选项是否适合您?
-
另外,如何在 docker 容器中运行测试?
标签: curl nginx https proxy dns