大网数据广告活动
服务器运维问答

Check website with through multiple IP address, without changing DNS

· 52CE 我爱测

I want to automate my website uptime and availability testing. i have sucuri proxy in place, after that there is a load balancer, and then there are application servers behind load balancer. is there any way i can automate the ch…

问题原文

原帖链接 · Farhan · CC BY-SA 3.0

I want to automate my website uptime and availability testing. i have sucuri proxy in place, after that there is a load balancer, and then there are application servers behind load balancer. is there any way i can automate the checking of my website to resolve to Sucuri proxy IP (1st) check its status,then check for pointing IP to LB, test it, and then point it to other application servers behind LB? I just want to do it to make sure that when disaster comes, then which portion of website is down, so i get instant notification of the failure at specific level.

Is it possible by adding website IP and url to hosts file?(through a bash script, then change hosts file accordingly for each test)? or there is any other way out for it?

已采纳解答

原帖链接 · Esa Jokinen · CC BY-SA 3.0

If you use curl for testing, check --resolve and -H i.e. --header.

This would imitate your hosts-file solution:

curl --resolve example.com:443:192.0.2.1 https://example.com:443/

While this replaces the Host: header:

curl -H "Host: example.com" https://appserver.example.com/

Those two can also be combined, if better for some parts of your testing.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-04-15)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。