Forum Discussion
jasona_40790
Jun 14, 2012Nimbostratus
need to rewrite HTTP 200 status code to HTTP 503
Hello,
I am performing website maintenance and need to bring down our website for a few hours. I will be
serving a friendly maintenance page during this time. However, when Google...
Richard__Harlan
Jun 15, 2012Historic F5 Account
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
when HTTP_REQUEST_SEND {
TCP::collect 12
log local0. "Added header"
}
when SERVER_DATA {
if {[findstr [TCP::payload 12] "200"] == "200"} {
TCP::payload replace 9 3 "503"
}
}
when HTTP_RESPONSE {
HTTP::header replace Retry-After 10800
}
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