Forum Discussion
F5 Maintenance Page
- Apr 01, 2024
Igor,
The iRule command HTTP::respond is a command, not a condition. You said that you want to respond with a maintenance page IF the response from the server is 503. So you need to include that condition in your iRule. Also, that condition, the server response code, cannot be known until we get a response form the server, so you will need to use the HTTP_RESPONSE event instead of the HTTP_REQUEST event. Finally, the server response code is accessible via the HTTP::status iRule command
It will look something like this:when HTTP_RESPONSE { if { [HTTP::status] eq "503" } { HTTP::respond 503 content { your response content goes here } } }
Hope that helps,
JM
Igor,
The iRule command HTTP::respond is a command, not a condition. You said that you want to respond with a maintenance page IF the response from the server is 503. So you need to include that condition in your iRule. Also, that condition, the server response code, cannot be known until we get a response form the server, so you will need to use the HTTP_RESPONSE event instead of the HTTP_REQUEST event. Finally, the server response code is accessible via the HTTP::status iRule command
It will look something like this:
when HTTP_RESPONSE {
if { [HTTP::status] eq "503" } {
HTTP::respond 503 content {
your response content
goes here
}
}
}
Hope that helps,
JM
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com