Forum Discussion

dogg_dogg_23774's avatar
dogg_dogg_23774
Icon for Nimbostratus rankNimbostratus
Sep 21, 2006

replacing host header

I am trying to have Big-IP replace the original HOST header with IP address of pool member that Big-IP load-balanced to.

 

For example, when accessing VS www.xxx.yyy, replace the Host header to 10.1.1.11. To accomplish the objective, I have configured the following rule:

 

 

when SERVER_CONNECTED {

 

HTTP::header replace Host "[IP::remote_addr]"

 

}

 

 

However I see the following error and it does not allow me to apply the rule to VS.

 

01070394:3: HTTP::header in rule (replace) requires an associated FASTHTTP profile on the virtual server (vs-sss).

 

 

As per the suggestion, I tried setting the VS type Performance http, but then i see no response from VS, or error message that "curl: (52) Empty reply from server"

 

 

Is there anything missing here or part of limitation?

 

 

Thanks in advance,

8 Replies

  • I found unRuleY's post (Click here)

    and thought that it might be that you're making L7 changes in an event that wasn't expecting them. But then I tried the following rule in the HTTP_REQUEST_SEND event and got another error.

    
    when HTTP_REQUEST_SEND {
    HTTP::header replace Host "my_host"
    }

    Sep 21 09:41:46 tmm tmm[1227]: 01220001:3: TCL error: Rule replace_host_rule - Out of bounds (line 1) invoked from within "HTTP::header replace Host "my_host""

    Unless someone else has suggestions, I'd contact support as this looks like a bug (or two?).

    Aaron

  • Actually, it looks like you did open a case. Please post here with what you find out.

     

     

    Thanks,

     

    Aaron
  • A solution was posted back in May that looks to be what you are hitting, maybe product development could confirm:

     

     

    https://tech.f5.com/home/solutions/sol4942.html

     

    Click here

     

     

     

    Here's the text of the solution:

     

     

     

    The HTTP Header Insert field of the FastHTTP profile allows you to insert an HTTP header into an HTTP request. However, the FastHTTP profile is designed for HTTP performance and only supports insertion of a static text HTTP header.

     

     

    The FastHTTP profile will not perform iRule variable expansion for the HTTP Header Insert field of the FastHTTP profile; this is considered an unnecessary performance hit for the FastHTTP profile.

     

     

    Note: The HTTP profile will perform iRule variable expansion for the HTTP Header Insert field of the HTTP profile.

     

     

    You can use an iRule in conjunction with the FastHTTP profile for the virtual server if the FastHTTP profile must be used and an HTTP header insertion requires iRule variable expansion. The iRule will use the HTTP::header insert iRule command and the HTTP_REQUEST event.

     

     

    For information about iRule creation and iRule compatibility with the FastHTTP profile, refer to the BIG-IP Configuration Guide for Local Traffic Management for your specific version. Additionally, for information about iRule functionality and assistance, refer to http://devcentral.f5.com.

     

     

    F5 Networks Product Development has entered a Feature Request (CR49530) to add iRule variable expansion functionality to the FastHTTP profile. To monitor the status of this CR, refer to the BIG-IP LTM Release Notes.

     

  • I believe both of us were testing with a standard HTTP VIP and profile. I tried removing the variable anyhow when I first tested and got the 'out of bounds' error.

     

     

    Apparently, the escalation team was able to successfully test the same rule I tried. I'm not sure why there would be a failure for me on 9.2.3 compared with their testing on 9.1.x though.

     

     

    Aaron
  • Thanks for all the replies.

     

    I just got workaround from escalation team and confirmed it is working as expected.

     

    FYI, I was doing my test on 9.4.0 beta 3.

     

     

    regards,
  • If you don't mind, could you post the workaround so as to benefit the community? TIA...
  •  

    Here is the rule known to work...

     

     

    when HTTP_REQUEST_SEND {

     

    clientside {

     

    HTTP::header replace Host "[LB::server addr]"

     

    }

     

    }

     

  • Is that a valid scenario? I tried it and it resulted in the ltm restarting. A case with F5 resulted in the following response:

     

     

    [The iRule is] attempting to use/manipulate the HTTP request in HTTP_REQUEST_SEND. HTTP_REQUEST_SEND is executed in the server-side context, so the HTTP commands are being serviced by the server-side, which does not yet have a response, so it panics, as executing HTTP commands in this context is unexpected.

     

     

    Keith