cancel
Showing results for 
Search instead for 
Did you mean: 

Intermediate server Response Header rewrite issue

rajuudagatti
Nimbostratus
Nimbostratus

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 

when HTTP_REQUEST {
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 "lotus.com") } {
HTTP::header replace Host "lotus.co.uk"
pool ROS
} else {
pool default_pool
}
}

 

 

 

 

1 REPLY 1

enesik
Nimbostratus
Nimbostratus

@rajuudagatti wrote:

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 

when HTTP_REQUEST {
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 "lotus.com") } {
HTTP::header replace Host "lotus.co.uk"
pool ROS
} else {
pool default_pool
}
}

 

 

 

 


If the OpenSSO agent determines that the user is not logged in, it raises a 302 redirect to the authentication server and provides the original (encoded) URL that the user requested as a GET parameter in the redirect location header.

However, the URL in the GET variable is that of the internal (secondary) proxy server, not the original proxy server. Therefore, I would like to edit/rewrite the "Location" response header to give the correct URL.