cancel
Showing results for 
Search instead for 
Did you mean: 
Login & Join the DevCentral Connects Group to watch the Recorded LiveStream (May 12) on Basic iControl Security - show notes included.
hooleylist
Cirrostratus
Cirrostratus

Problem this snippet solves:

On each HTTP request, the iRule replaces the Host header value with the selected pool member IP address and port. Some web servers and web applications require this to serve requests.

Code :

# From: https://devcentral.f5.com/s/wiki/iRules.http_request_send.ashx
when HTTP_REQUEST_SEND {

   # Need to force the host header replacement and HTTP:: commands into the clientside context
   # as the HTTP_REQUEST_SEND event is in the serverside context
   clientside {

      # Replace the HTTP host header with the selected server IP and port
      HTTP::header replace Host "[LB::server addr]:[LB::server port]"
   }
}
Version history
Last update:
‎18-Mar-2015 14:52
Updated by:
Contributors