Forum Discussion
Frank_J_104756
Oct 31, 2007Historic F5 Account
HTTP::payload replace
I have 2 needs...1 to replace/hide the server in the http redirects that are being sent by the node. 2) to replace/hide the server in the actual content.
when HTTP_RESPONSE {
if...
Frank_J_104756
Oct 31, 2007Historic F5 Account
Aaron, I'm not getting errors anymore but it appears like none of the HTTP_RESPONSE_DATA section is even running. I put a log entry at the beginning of it to see if I got anything and I didn't. Here's what I have in teh irule now...
when HTTP_RESPONSE {
if { [HTTP::status] starts_with "301" } {
if { [LB::server addr] eq "10.0.19.50" } {
HTTP::header replace Location [string map {nwte1jas7:8882 E1NP.crocs.com} [HTTP::header Location]]
log "replacing nwte1jas7:8882 in header with E1NP" }
elseif { [LB::server addr] eq "10.0.19.42" } {
HTTP::header replace Location [string map {nwte1jas6:8882 E1NP.crocs.com} [HTTP::header Location]]
log "replacing nwte1jas7:8882 in header with E1NP" }
}
}
when HTTP_RESPONSE_DATA {
if { [LB::server addr] eq "10.0.19.50" } {
regsub -all "nwte1jas7:8882" [HTTP::payload] "bob" newdata
log "Replacing nwtejas7:8882 with bob in the payload."
HTTP::payload replace 0 [HTTP::payload length] [string map {nwte1jas7:8882 E1NP.crocs.com} [HTTP::payload]]
HTTP::release }
elseif { [LB::server addr] eq "10.0.19.42" } {
regsub -all "nwte1jas6:8882" [HTTP::payload] "bob" newdata
log "Replacing nwtejas6:8882 with bob in the payload."
HTTP::payload replace 0 [HTTP::payload length] [string map {nwte1jas6:8882 E1NP.crocs.com} [HTTP::payload]]
HTTP::release }
}
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
