simulate F5 health check requests with empty Host header

The curl tool is one of the tool you use on a daily basis when verifying and checking health checks on the F5 load balancer. But it has its limitations. One of these is that it don’t insert an empty Host header.

# curl -v -H ‘Host:’ -o tmp
* About to connect() to port 80
* Trying… connected
* Connected to ( port 80
> GET /id.aspx HTTP/1.1
> User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
> Accept: */*

This simple command will use nc tool to initiate a TCP session and sent the whole HTTP request as you define it in the string between the quotes. That way we can simulate an empty Host header if we need it. For more option how to troubleshoot monitoring issue check this one

$ echo -e “GET / HTTP/1.1\r\nHost:\r\nConnection: Close\r\n\r\n” | tee req.txt | nc -v 80
$ cat req.txt
GET / HTTP/1.1
Connection: Close

Was this article helpful?

Related Articles

Leave A Comment?

You must be logged in to post a comment.