Forum Discussion

AlgebraicMirror's avatar
AlgebraicMirror
Icon for Altostratus rankAltostratus
Oct 06, 2016

In APM Customization, server's HTTP_HOST variable not set correctly? Any other way to get this?

I'm attempting to do some APM customization, and I'm trying to write some simple PHP that will substitute text on the page based on the Host header in the HTTP request (we are using this same policy on multiple virtual servers for multiple sites, and everything is identical except for some tiny verbiage changes on the logon page... I know I could probably break this into multiple policies, but I'd rather just have one so I don't have to manage multiple).

Anyway, in trying to determine which site has been requested, I want to make a decision based on the Host header. I attempt to read it like this:


It turns out that the value of $_SERVER['HTTP_HOST'] is "f5-server". I would understand that if I had asked for 'SERVER_NAME' rather than 'HTTP_HOST', but that's definitely not right for HTTP_HOST and is not what the user had in their host header.

Does anyone have any idea about other ways to get the host header in PHP, or ways to get the Big-IP to correctly return it?