Manual Chapter :
Returning HTTP Status 503 to Web Applications
Applies To:
Show VersionsBIG-IP APM
- 17.1.0, 17.0.0, 16.1.5, 16.1.4, 16.1.3, 16.1.2, 16.1.1, 16.1.0
Returning HTTP Status 503 to Web Applications
Overview: Returning HTTP status code 503 for
APM-generated error pages
Access Policy Manager (APM®) sends an error page to
a web application when, for example, the application sends a request to a non-existent domain
name or uses a URL that is blocked by the configuration. By default, the error page is a
human-readable HTML page with HTTP status 200. This can lead to errors if the web application
expects an error status or error notifications, but receives a normal reply. Instead, proxy
servers can reply with HTTP status 503. Current browsers display the content of HTTP 503
replies to the user, if possible, and client code can recognize an abnormal situation.
To change the default behavior to reply with HTTP status code 503 for an APM-generated error
page, you can configure an access profile or an access policy.
- To change the default behavior for any client session created through the access profile, configure a setting in the access profile.
- To change the default behavior for a client session based on any criteria that you want, configure logic (and a session variable) in the access policy.
Configuring an access profile to return
HTTP status code 503
For Access Policy
Manager (APM) to return an HTTP status code 503 for
APM-generated error pages, you can select
Use HTTP Status 503 for Error
Pages
in the access profile. - On the Main tab, click.The Access Profiles (Per-Session Policies) screen opens.
- Click the name of the access profile that you want to edit.The properties screen opens.
- ForSettings, select theCustomcheck box.The settings become available to edit.
- Select theUse HTTP Status 503 for Error Pagescheck box.
- ClickFinished.
For APM-generated error pages, APM
returns HTTP status code 503 instead of HTTP 200 for traffic on the virtual server
associated with this access profile.
Configuring an access policy to return
HTTP status code 503
You can set the value of the
session.error.use503
session variable in an access policy to change the
HTTP status code that Access Policy Manager (APM) returns for error pages that APM generates. If you enable the session
variable, APM responds with HTTP status 503. If you disable the session variable later
on the branch, APM goes back to returning HTTP status 200, which is the default
behavior. If the
Use HTTP Status 503 for Error Pages
check box is selected
in the access profile, changing the value of the session.error.use503
session variable in an access policy has no effect.- On the Main tab, click.The Access Profiles (Per-Session Policies) screen opens.
- In the Per-Session Policy column, click theEditlink for the access profile you want to configure.The visual policy editor opens the access policy in a separate screen.
- Add items to the policy to specify the criteria under which you want APM to return HTTP status 503.
- On the policy branch where you want APM to return HTTP status 503, click the(+)icon to add an item to the policy.A popup screen displays actions on tabs, such as General Purpose and Authentication, and provides a search field.
- On the Assignment tab, selectVariable Assignand clickAdd Item.A properties screen opens.
- ClickAdd new entry.AnEmptyentry displays.
- Click thechangelink next to the empty entry.A dialog box, where you can enter a variable and an expression, opens.
- On the left side, retain the default setting,Custom Expression, and in the field typesession.error.use503.
- On the right side, selecttextfrom the list and set the value of the session variable:
- To use HTTP status 503 for APM-generated error pages, type any letter or word in the field, such ast.
- To restore the default behavior (use the HTTP status 200 for error pages), remove all text from the field.
- ClickFinishedto save the variable and expression and return to the Variable Assign action popup screen.
- ClickSave.The properties screen closes and the policy displays.
- Click theApply Access Policylink to apply and activate the changes to the policy.