respond
5 TopicsWhat to do after HTTP::respond ?
Hello, I currently have a maintenance-unavailable iRule that returns a HTML page when the vs is in maintenance mode (value in datagroup list) or is not available. (LB_FAILED) My first check is if the URI is an image that is linked to in the page. If yes, HTTP::respond with a Connection: Close header, disable all future iRule events & TCP::close. This seems a very hacky way of doing this. I manually close the TCP connection because for some apps, we have an IIS request forwarder in front of the bigip that may do connection pooling; event disable all would disable all iRules for all applications on that TCP connection. How are you all doing this? priority 50 when HTTP_REQUEST { if { [HTTP::uri] eq "/bip-company-logo.gif" }{ HTTP::respond 200 content [ifile get "company-logo"] noserver Content-Type image/gif Connection Close event disable all TCP::close return } if { [class match -value [virtual name] equals "maintenance-list"] eq "1" } { if { [HTTP::uri] eq "/favicon.ico" }{ HTTP::respond 404 noserver Connection Close event disable all TCP::close return } if { [virtual name] starts_with "/ITSS/" }{ set contact "your Regional Helpdesk" } else { set contact "Application Support () or your Regional Helpdesk" } HTTP::respond 200 content " Down for maintenance - company Maintenance This application is currently undergoing maintenance. It should be available again within the specified time period. For any questions, please contact $contact. " noserver Connection Close event disable all TCP::close } } when LB_FAILED { if { [virtual name] starts_with "/ITSS/" }{ set contact "your Regional Helpdesk" } else { set contact "Application Support () or your Regional Helpdesk" } HTTP::respond 503 content " Application Unavailable - company Application unavailable This application is currently not available. Please contact $contact. " noserver Connection Close event disable all TCP::close }1.6KViews0likes18CommentsEnable event Processing after HTTP::respond
I currently have an iRule that responds directly from the F5 with the HTTP::respond event. However, I would also like other iRules which log request/response to fire but they are not. From my searches on DevCentral, it looks like invoking the HTTP::respond causes all other events to be bypassed. Is there any way to get around this so that the request/response are still logged correctly? I have tried surrounding the HTTP::respond with 'event enable' but that doesn't seem to help. Thanks!400Views0likes5CommentsWarning when using the reset-Option in HTTP::respond
Hi everyone, I´m having trouble using the reset-Option of HTTP::respond in the following line in my iRule: HTTP::respond -reset 404 -version 1.1 noserver When I safe the iRule, I´m getting this warning in the LTM-Log warning: [The following errors were not caught before. Please correct the script in order to avoid future disruption. "-reset is invalid integer"1096 47][HTTP::respond -reset 404 -version 1.1 noserver] I really can´t see the difference between my line and the one in the DevCentral-Page (https://devcentral.f5.com/wiki/iRules.HTTP__respond.ashx) I´m using BIG-IP 12.1.1. Any help is welcome. Mike279Views0likes1CommentHelp needed: HTTP::respond does not add headers
I am struggling with HTTP::respond and adding headers. This is an outline of what I am trying to do: when HTTP_RESPONSE { Save response-headers for later use set headers "" foreach aHeader [HTTP::header names] { set headers [concat $headers $aHeader [HTTP::header value $aHeader]] } log local0. "Headers Saved: $headers" Fetch "x-http-statuscode" for later use if {[HTTP::header exists "x-http-statuscode"]} { set xhttpstatuscode [lindex [HTTP::header values x-http-statuscode] 0] } if {[HTTP::status] == 200 && [expr {$xhttpstatuscode != 200}]} { HTTP::respond $xhttpstatuscode -version [HTTP::version] content [HTTP::payload] $headers } } I can't get HTTP::repond to add the "original headers"! Help is appreciated!267Views0likes1CommentLogging F5 response via Logging profile
Hi, I am preparing a rule which limits requests per second based on IP and endpoint. There is also prepared response logging profile which sends logs to specific server with Elastic via TCP. Request limit in my rule is 3 per 1 second which triggers HTTP::respond with 429 status code but in my logs I can't see it. How possibly could I modify my iRule to log it too?Solved96Views0likes2Comments