Forum Discussion

callerys_137261's avatar
callerys_137261
Icon for Nimbostratus rankNimbostratus
Mar 15, 2017

Header replacement irule

Attempting to replace the host header with the FQDN of the node being load balanced to. I found the following iRule in another post however something isn't correct. when HTTP_REQUEST_SEND {

clientside {

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

} }

Error: TCL error: /Common/header - invalid command name "HTTP::u&8221" while executing "HTTP::u&8221"invalid peer expression (line 5) invoked from within "clientside { Replace the HTTP host header with the selected server IP and port HTTP::header replace Host "[LB::server addr]:[LB::server..."

What am I missing here?

1 Reply

  • HTTP_REQUEST_SEND is a server-side context event. You could try this instead:

    when LB_SELECTED {
       HTTP::header replace Host "[LB::server addr]:[LB::server port]"
    }