HTTP_RESPONSE

Description

An iRule event triggered when the system parses all of the response status and header lines from the server response.
Note: HTTP_RESPONSE is specific to a server response passing through the load balancer, and is not triggered for locally-generated responses (e.g. sent using the HTTP::respond command)

Examples

when HTTP_RESPONSE {
  if { [HTTP::status] contains "404"} {
    HTTP::redirect "http://www.siterequest.com/"
  }
}

when HTTP_RESPONSE {
  HTTP::header insert SERVER_ADDRESS [IP::server_addr]
  log "SERVER_ADDRESS [IP::server_addr]"
}

If the
reject

command is used in this event without

HTTP::collect

, the BIG-IP will forward the server generated headers to the client, then send a TCP RST segment. To send a RST without headers in response to a specific server response condition, execute

HTTP::collect

before

reject
, as in:
when HTTP_RESPONSE {
    if { [HTTP::status] == 404 } {
        HTTP::collect
        reject
    }
}