我有一個Nginx服務集合,用作單個地址的負載平衡器,比如說www.example.com
。我希望有一個測試套件可以獨立地針對每臺機器,而不是通過DNS負載平衡,就像直接訪問地址一樣。如何通過HTTPS測試特定負載均衡器實例?
當我嘗試做這樣的事情在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解析?
主機文件操作灰燼爲你工作? –
另外如何在碼頭集裝箱內運行測試? –