Forum Discussion
Awkrd1_7470
Feb 23, 2012Nimbostratus
Unable to identify HTTP header variable for pool redirection
I have a two tier load balancing scenario where my client is accessing a load balanced SOA environment which I'll call my "upper load balance tier". The upper load balance tier accesses a VIP on the "...
Awkrd1_7470
Feb 24, 2012Nimbostratus
Correct...It should have been on the HTTP_REQUEST. I need to load balance the initial client request, which would not have the HTTP header "datacenter" present. The server inserts the HTTP header "datacenter" 01 or 02 in the response for the client's subsequent request to be used by the i-Rule and returned to the same data center. I modified the rule to add logging;
when HTTP_REQUEST {
set LogString "Client [IP::client_addr]:[TCP::client_port] -> [HTTP::host][HTTP::uri]"
log local0. "============================================="
log local0. "$LogString (request)"
foreach aHeader [HTTP::header names] {
log local0. "$aHeader: [HTTP::header value $aHeader]"
}
log local0. "============================================="
if { [HTTP::header "datacenter"] eq "01" } {
pool PROD-ITA-9045-BILLERICA
log local0. "$HTTP::header"
} elseif { [HTTP::header "datacenter"] eq "02" } {
pool PROD-ITA-9045-WINNIPEG
log local0. "$HTTP::header"
} else {
pool PROD-ITA-9045
}
}
I think it may be working but I am only directed to datacenter-01, which may be a limitation of my SOAPUI client.
Could I not simplify this using universal persistence and a simple i-Rule?
when HTTP_REQUEST {
persist uie [HTTP::header datacenter]
}
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