Forum Discussion

1 Reply

  • The health monitor is making an explicit GET request to a pool of web servers. If you've ever looked at an HTTP request on the wire (ie. not a browser but some tool like cURL), then you'd have seen something like this:

    GET /something HTTP/1.1
    Host: www.someplace.com
    Accept: *.*
    ... a bunch of other headers...
    

    An HTTP request is this first line (method, resource, protocol version) followed by several lines of HTTP headers that tell the server attributes of the request and of the client. What you don't see in the above is the implied carriage return-line feeds. So what you're basically doing in the health monitor is putting all of the above on a single line and explicitly separating each line with \r\n (carriage return and line feed characters).

    GET /something HTTP/1.1\r\nHost: www.something.com\r\nAccept: *.*\r\n...
    

    Which then ends with TWO blank lines: \r\n\r\n

    It just so happens that HTTP/1.1 per RFC requires that you submit a Host header. Most servers don't really care what the value is, as long as you send something. So you could just do:

    Host: localhost.localdomain
    

    But you do need it.