Networking, Opensource and Experience

top line

cURL and host header to bypass F5

The main problem when I try to check monitong string on server side from client, the original behaviour will push the connection to the load balancer if I try to connect to www.example.com and then the load balancer will handed off the connection to a random server. If I want to connect directly to each server servers so I’ll need to use their IP address. This approach would look something like:

curl --verbose 'http://x.x.x.x:xxxx/monitoring_file.html'

But since the servers use name-based virtual hosts so we’d get a 404 error back. The trick is to have curl send the proper host header:

curl --verbose --header 'Host: www.example.com' 'http://x.x.x.x:xxxx/the_url_to_test'

Zikrillah

An ordinary person who use a keyboard to print a word on his screen, "an experienced keyboard user".

No comments :

Post a Comment

Leave a Comment...