Forum Discussion
Joern_Oltmann
Nimbostratus
Mar 17, 2016Requirement deliver Status Page if a specify URL response with error code 5xx
Hi All,
My BigIP should be deliver the following status page if the URL "/internal_api" response with an error code 5xx. How can I realize this with an iRule. Would be great someone can help me.
Status Page:
Header: Content-Type: application/json Response-Code: 500 Response-Body:
{"error_type":"internal_server_error"}
Thx Joern
4 Replies
- VernonWells
Employee
Not tested, but this should do the trick:
when HTTP_REQUEST { set path [HTTP::path] } when HTTP_RESPONSE { if { [HTTP::status] starts_with "5" && $path eq "/internal_api" } { HTTP::respond 500 "{\"error_type\":\"internal_server_error\"}" Content-Type "application/json" } }- Joern_Oltmann
Nimbostratus
Hi Vernon, thanks a lot, I will test it on ou lab and come back if it's work!
- Vernon_97235Historic F5 Account
Not tested, but this should do the trick:
when HTTP_REQUEST { set path [HTTP::path] } when HTTP_RESPONSE { if { [HTTP::status] starts_with "5" && $path eq "/internal_api" } { HTTP::respond 500 "{\"error_type\":\"internal_server_error\"}" Content-Type "application/json" } }- Joern_Oltmann
Nimbostratus
Hi Vernon, thanks a lot, I will test it on ou lab and come back if it's work!
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects