Forum Discussion
How to filter within iRule for HTTP_RESPONSE
That actually makes sense and would explain why what im seeing in Fiddler. The setup we have is very complex. All backend webservers are setup with the same directory names, databases etc... So we are ripping out the 'uat' parts,
1) Within the Request we have:
elseif {$uri contains "/uat_xxx"}{
switch -glob [string tolower [HTTP::uri]] {
"*uat_xxx_DB" {
pool POOL1
HTTP::header remove "Accept-Encoding"
HTTP::header replace Location [string map -nocase {"uat_xxx_DB" "xxx_DB"} [HTTP::header Location]]
HTTP::uri [string map -nocase {"uat_xxx_DB" "xxx_DB"} [HTTP::uri]]
STREAM::disable }
"uat_xxx"*" {
pool POOL1
HTTP::header remove "Accept-Encoding"
HTTP::header replace Location [string map -nocase {"uat_xxx" "xxx"} [HTTP::header Location]]
HTTP::uri [string map -nocase {"uat_xxx" "xxx"} [HTTP::uri]]
STREAM::disable }
}
}
So two different URIs going to the same pool with a uri / http header modification
2) So with the response, we need to convert the header and the stream back to what the user sees. How would i go about doing this? As you mentioned i cant use Location as it wont convert it all back (only the redirect responses). I can get it working with one URI in play as all i would have to do is use something like in the Response:
elseif {[LB::server pool] contains "POOL1"}{
But as you can see from my request, 2xURIs are using the same pool so i cant use the above. I have attemped to filter on a custom header i inserted within the request but running into the same problems.
I hope this helps!
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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
