Technical Forum
Ask questions. Discover Answers.
Showing results for 
Search instead for 
Did you mean: 
Custom Alert Banner

Intermediate server Response Header rewrite issue


Hi Team,

i have problem to catch and appending custom header when sending to another server( sending response from one server to another server with header fileds modification ). Below is the requirement

Backend server to F5 hits with 5 headers v,w,x,y,z

F5 switch traffic to pool ABC by removing 3 headers v, y and z if header z is having value as 'token' keeping x header as it is  otherwise switch traffic to pool ROS all existing headers

Response from pool ABC reaches back to F5 by modifying some value with header x

Now f5 has to send recently received response from pool ABC to pool ROS with attaching again headers v and y along with x . 

How can i wirte an irule to meet this requirement by holding response and ataching to header again. Below is the i rule what i have written ,  appreciate the support if anybody could responsd with further irule commands 

if { ([HTTP::header value z] contains "token")} {
HTTP::header remove z
HTTP::header remove v
HTTP::header remove y
pool ABC
} elseif { ([string tolower [HTTP::host]] eq "") } {
HTTP::header replace Host ""
pool ROS
} else {
pool default_pool