Version notice:
HTTP_RESPONSE¶
Description¶
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]"
}
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
when HTTP_RESPONSE {
if { [HTTP::status] == 404 } {
HTTP::collect
reject
}
}
Related Information¶
Available Commands:
- CACHE::disable - Disables the caching for this request.
- CACHE::enable - Forces the document to be cached.
- CATEGORY::analytics - enables or disables the analytics server on a per request basis
- CLASSIFY::application - allows you to set or add an app name to the classification.
- CLASSIFY::category - allows you to set or add a category name to the classification
- CLASSIFY::urlcat - allows you to set or add an url category to the classification.
- clone - Causes the system to clone traffic to the specified pool or pool member regardless of monitor status.
- COMPRESS::buffer_size - Sets the compression buffer size.
- COMPRESS::disable - Disables compression for the current HTTP response.
- COMPRESS::enable - Enables compression for the current HTTP response.
- COMPRESS::gzip - Sets HTTP data compression criteria.
- forward - Sets the connection to forward IP packets.
- HTTP::close - Closes the HTTP connection.
- HTTP::collect - Collects an amount of HTTP body data that you specify.
- HTTP::cookie - Queries for or manipulates cookies in HTTP requests and responses.
- HTTP::fallback - Specifies or overrides a fallback host specified in the HTTP profile.
- HTTP::header - Queries or modifies HTTP headers.
- HTTP::host - Returns the value of the HTTP Host header
- HTTP::is_keepalive - Returns a true value if this is a Keep-Alive connection.
- HTTP::is_redirect - Returns a true value if the response is a redirect.
- HTTP::password - Returns the password part of HTTP basic authentication.
- HTTP::payload - Queries for or manipulates HTTP payload information.
- HTTP::redirect - Redirects an HTTP request or response to the specified URL.
- HTTP::request_num - Returns the number of HTTP requests that a client made on the connection.
- HTTP::respond - Generates a response to the client as if it came from the server.
- HTTP::retry - Resends a request to a server.
- HTTP::status - Returns the response status code.
- HTTP::username - Returns the username part of HTTP basic authentication.
- HTTP::version - Returns or sets the HTTP version of the request or response.
- imid - Returns an i-mode identifier string.
- IP::client_addr - Returns the client IP address of a connection
- IP::idle_timeout - Returns or sets the idle timeout value.
- IP::local_addr - Returns the IP address of the virtual server the client is connected to or the self-ip LTM is connected from.
- IP::server_addr - Returns the server’s IP address.
- ip_ttl - Returns the TTL of the latest IP packet received.
- lasthop - Sets the lasthop of an IP connection.
- LB::server - Returns information about the currently selected server
- listen - Sets up a related ephemeral listener to allow an incoming related connection to be established.
- nexthop - Sets the nexthop of an IP connection.
- node - Sends the packet directly to the identified server node.
- peer - Causes the specified iRule commands to be evaluated under the peer’s (opposite) context.
- persist - Causes the system to use the named persistence type to persist the connection.
- session - Utilizes the persistence table to store arbitrary information based on the same keys as persistence.
- SSL::cert - Returns X509 SSL certificate data.
- URI::query - Returns the query string portion of the given URI or the value of a query string parameter.
Warning
The links to the sample code below are remnants of the old DevCentral wiki and will result in a 404 error. For best results, please copy the link text and search the codeshare directly on DevCentral.
Sample Code:
- Apache Style Logging Slightly Modified - When SNATing to servers. the client IP is lost. This was information our se…
- ASP Session ID Persistence - Persist on ASP SessionID cookie value or PID.
- Client Auth Using HTTP Cookie - This iRule illustrates how to use HTTP Cookies for client based authentcation.
- Content type tracking - Have you ever wondered what types of content are served by your web servers…
- Convert 404s to Blank 200s - An iRule to convert an HTTP 404 response to a blank 200 response. HTTP 404…
- Credit Card Scrubber - This iRule illustrates how to scrub out Credit Card Numbers from HTTP traffic.
- Credit Card Scrubber Using a Stream Profile - This iRule illustrates how to scrub out Credit Card Numbers from HTTP traffic using a STREAM profile.
- Custom Apache-style logging for Java-based applications - I had a requirement to have the F5 BigIP produce logs which replicated our …
- Data Leakage Protection - Scrub sensitive data from application responses
- Encrypting Cookies - This example shows how to encrypt and decrypt a HTTP cookie from within an iRule.
- Excessive_404_Blacklist - This iRule will block ALL further site access to source IP addresses that exceed a certain number of HTTP requests to server resources that results in a 404 not found error.
- File Not Found Handler - This iRule will handle HTTP 404 (File Not Found) errors returned from pool members and return an embedded customized error page.
- Force No Cache on Response - This simple iRule forces browsers to not cache content with the no-cache header
- Formatted Logging For W3c - This iRule Allows you to log traffic in a W3C compliant fashion.
- Gomez Injection - Auto injection of Gomez Networks Actual XF client side Javascript.
- Gomez Injection With Group Id - Auto injection of Gomez Networks Actual XF client side Javascript.
- HTML Comment Scrubber - This iRule will remove all HTML comments and replace them with white space.
- HTML comment scrubber using a stream profile - Removes HTML comments from server responses
- HTTP delay and validate clients using javascript cookies when CPU overloaded - If CPU usage high. delay clients and validate they’re real by making sure they can execute javascript.
- … - If CPU usage is over $::maxcpu (default 60%). send the client javascript th…
- HTTP method conversion - This is one way that allows you to convert HTTP method from GET to POST or …
- HTTP prefetch insertion - This iRule demonstrate how to use BIG-IP to insert prefetch hint/force to http response from server.
- HTTP redirect to HTTPS with pool down detection - I pieced this together from several rules because I couldn’t find a rule th…
- HTTP session limit - HTTP Session limiting for LTM v10.1 using tables.
- HTTP sideband policy checking - iRule for HTTP sideband policy checking
- HTTP Payload Collection - iRule demonstrating the basic approach for collection and manipulation of HTTP payload data.
- HTTP retry on 404 pre-9.2.0 - Mimic LB::reselect and HTTP::retry for pre-9.2.0 boxes
- HTTP Serverside Chunking For One Dot Zero Requests - iRule demonstrating how to transform the serverside flow to 1.1 for 1.0 requests
- HTTP Session Limit - Limits total concurrent HTTP sessions to a pre-defined threshhold. allowing those clients with a session cookie to continue once the limit is reached. while redirecting new clients until con…
- HTTPS offload rewriting - Rewrite an HTTP web application’s self references from http:// to https://
- HTTP To HTTPS Cookie Persistence - Persist on HTTP cookie while going from HTTP to HTTPS
- Insert App Cookies In Http Redirect - This rule intercepts the application response and sends an HTTP redirect to…
- Insert Content Into Server Response - This iRule inserts content into a server response using HTTP::payload replace.
- Log Http Tcp Udp To Syslogng - You can use iRules to log a summary of each request and its response. and send the data to a remote syslog server using BIG-IP’s syslog-ng daemon.
- Manual cookie persistence - I had an app admin ask me for a way to temporarily force node assignment. f…
- Microsoft Branch Cache Hash Offload - Hash Offload for Microsoft BranchCache
- Open SSO Authentication - A simple “Policy Agent” iRule that ensures that all incoming HTTP requests …
- Outlook Anywhere Persistence with Cookie Backup - The deployment guide for Microsoft Exchange Server 2007 (http://www.f5.com/…
- Persist client on response content with stream - Persist a client based on a string found in the response content using a stream profile
- Phishing Prevention - This iRule helps to cut down on Phishing and scraping attempts that might otherwise plague your network.
- Proxy Auth - Provides Authentication offload onto an service such as LDAP.
- Redirect Location header validator - Validate the 30x redirects a web application sends back to clients
- Redirect Trapper - iRule to trap server redirect response, follow the redirect on the BIG-IP and return the followed response to the client as a result of original request
- Remove X- Headers From Web Server Response - Remove any X- header from web server HTTP responses
- Replace HTTP refresh with HTTP Redirect - Intercepts pages with HTTP REFRESH and re-writes as a proper 302 redirect
- Reverse Proxy With Basic SSO - The iRule implements a authenticated HTTPS reverse proxy.
- Rewrite HTTP redirect 301 to 302 - Re-writes server-set Permanent Redirects as Temporary Redirects
- Rewrite HTTP Redirect Hostname - Rewrites hostname in server-set redirects
- Rewrite HTTP Redirect Port - Removes the server’s port from the Location header in server-set redirects
- Rewriting Single Part HTTP Responses As Multipart - Transform a single part HTTP response into a multi-part response
- Select pool member based on HTTP query string parameter - Allow clients to manually select a pool member based on a parameter set in the HTTP query string. with persistence.
- Server Resource Cloaking - This iRule illustrates how to “hide” server specifics from snooping clients.
- Simulating TCP Closes From Server When Using ASM - Using iRules to simulate server layer 5 TCP closes with BIG-IP ASM
- Social Security Number Scrubbing - This sample iRule will search all outbound HTTP traffic and mask all social security numbers.
- SSL Termination - Finds and replaces a link or specific text with another link or text. can be used for Sharepoint Portal SSL Termination
- Uri version mapping - This rule implements a stripped down set of functionality of the ProxyPass …
- Weblogic JSessionID Persistence - Provides persistence on the jsessionid value found in either the URI or a cookie.
- Weblogic JSessionID Persistence for Session Replication - Persists HTTP requests on the primary and secondary server values found in the JSESSIONID cookie when the WebLogic servers implement session replication across two servers
- Introduced: BIGIP-9.0.0
The BIG-IP API Reference documentation contains community-contributed content. F5 does not monitor or control community code contributions. We make no guarantees or warranties regarding the available code, and it may contain errors, defects, bugs, inaccuracies, or security vulnerabilities. Your access to and use of any code available in the BIG-IP API reference guides is solely at your own risk.