ltm rule command ACCESS respond
iRule(1) BIG-IP TMSH Manual iRule(1)
ACCESS::respond
This command generates new respond and automatically overrides the
default respond.
SYNOPSIS
ACCESS::respond STATUS_CODE (ifile | -ifile) IFILE_OBJ
ACCESS::respond STATUS_CODE (((('content' | '-content') CONTENT)
('noserver' | '-noserver')
('nocookie' | '-nocookie')
(ACCESS_RESPOND_HEADER_NAME
HEADER_VALUE))#)?
DESCRIPTION
This command generates new respond and automatically overrides the
default respond. This command only can be used only once per HTTP
request, and subsequent calls to this command will return an error.
Notes:
Additional capabilities:
* ACCESS::respond will ignores empty header name, but not header
value. e.g. ACCESS::respond 200 content $body $header_name
$header_value. If $header_name is empty, ACCESS::respond will also
ignore $header_value.
* By default keeping connection alive is determined by HTTP hudfilter
via http_keepalive(). The admin can override Keep-Alive state to
force connection close via specifying header Connection Close.
Currrently we don't support forcing connection to be keep-alive.
* For 401, This command will automatically insert this header
WWW-Authenticate: Basic realm="". This can be overriden by
specifying WWW-Authenticate header value.
Changed behavior on ACCESS
* As above, this command will override the default respond. If there
is no respond, such as forwarding the request to the backend
server, this command will cancel that forwarding.
* ACCESS default response is actually closing the connection. When
this command is used, ACCESS will no longer close the connection
unless admin force to close it via Connection header.
ACCESS::respond [content ] [noserver] [ ]
* Requires APM module
RETURN VALUE
VALID DURING
ACCESS_ACL_ALLOWED, ACCESS_ACL_DENIED, ACCESS_POLICY_COMPLETED,
ACCESS_SESSION_STARTED
EXAMPLES
when ACCESS_POLICY_COMPLETED {
set policy_result [ACCESS::policy result]
switch $policy_result {
"allow" {
# Do nothing
}
"deny" {
ACCESS::respond 401 content "Error: Failure in Authentication" Connection Close
}
}
}
HINTS
SEE ALSO
CHANGE LOG
@BIGIP-10.2.0 --First introduced the command.
BIG-IP 2017-01-31 iRule(1)