In your iRule you are sending a respond to the request so the LTM will not send the request to the pool. This pop up awhile ago to the iRule and did a small change so it should work in your setup.
Do you see any errors in /var/log/ltm when you test that iRule? Are there other iRules or HTTP profile config options that might be sending a redirect? If so, you could disable all other iRules when you’re using the maintenance iRule using event disable all:
https://devcentral.f5.com/wiki/iRules.event.ashx
when HTTP_REQUEST {
HTTP::respond 503 noserver Retry-After: 10800
event disable all
}
Well, I added the ‘Retry-After’ code to my iRule and, while the iRule syntax accepted it, the maintenance page in the VIP is not accessible. I’ve posted my entire iRule. If I put the ‘Retry-After’ code anywhere else in the HTTP_REQUEST_SEND section, the iRule syntax will not accept it.
Can you post the error in /var/log/ltm. Most likely I over looked a syntex error whihc will cause the LTM to reset the connection and not display the page.
TCL error: iRule-Downtime503 - Illegal argument. Can’t execute in the current context. (line 1) invoked from within “HTTP::header exists “Retry-After””
Jun 14 16:04:18 local/tmm err tmm[7807]: 01220001:3: TCL error: iRule-Downtime503 - Illegal argument. Can’t execute in the curre nt context. (line 1) invoked from within “HTTP::header exists “Retry-After””
Jun 14 17:18:56 local/tmm1 err tmm1[7808]: 01220001:3: TCL error: iRule-Downtime503 - Illegal argument. Can’t execute in the current context. (line 1) invoked from within “HTTP::header replace Retry-After: 10800”
Ok I am a idiot there is two issues first HtTP_REQUEST_SEND should allow you to change headers but I think we have to be in server side context. The main problem is I told you to put the HTTP::header in HTTP_REQUEST_SEND. This is the event right before the LTM sends the request to the server side proxy. So this is the request to the server. When you need to change the response to the client. I fix the rule and ran it though some test and it seem to work and change the header. Again sorry for flipping the events
It works, thank you. There is one more thing I’m hoping to do here. The 503 status text response is ‘HTTP/1.1 503 OK’. How do I get this to be ‘HTTP/1.1 503 Service Unavailable’?