Forum Discussion
Pat_Miller_9897
Nimbostratus
Apr 23, 2009New pool or Virtual Server Connection from within HTTP_RESPONSE
In the code below, I see the log message redirect, But it will not call a new virtual or a new pool.
I have an inbound soap request, that I do not know what pool to send it to, My plan was to:
Send the URI headers to a pool to return the version So I can do a lookup. ( This is working )
From the Response look to see if its a redirect ( this works )
Do a select based on the Version ( This works )
Call a new pool or virtual server ( does not work )
I do not know if after I send the request to a new pool or virtual server if it can pickup the rest of the Data from the Client.
My remote sites do not all support 30x redirects for posts.
Many Thanks
Pat
when CLIENT_ACCEPTED {
set debug "1"
set esbi_count "1"
if $debug { log local0. "HTTP Rule int" }
}
when HTTP_REQUEST_DATA {
if $debug { log local0. "HTTP_REQUEST_DATA" }
}
when HTTP_RESPONSE {
if $debug { log local0. "ReSponse" }
if { [ HTTP::is_redirect ] } {
if $debug { log local0. "redirect" }
set esbi_count "1"
set Tenant_Version2 [HTTP::cookie tenant_VERSION]
if $debug { log local0. "before switch to $Tenant_Version2" }
switch $Tenant_Version2 {
v7_0 {
if $debug { log local0. "v7_0" }
virtual V_Apache2211
}
v8_0 {
if $debug { log local0. "v8_0" }
virtual V_SFTP_01
}
default { HTTP::redirect "http://www.somesite.com/very_bad_uri.php" }
}
} else {
if $debug { log local0. "no redirect" }
}
}
when HTTP_REQUEST {
if $esbi_count { log local0. "ReSponse bit set" }
if $debug { log local0. "HTTP Request Start" }
if $debug {log local0. "JSESSION: [HTTP::cookie JSESSIONID]" }
if $debug {log local0. "Default HOST: [HTTP::host]"}
set Tenant_Name ""
set Tenant_Version ""
set Tenant_URL ""
if $debug {log local0. "URI: [HTTP::uri]"}
if $debug {log local0. "Tenant Version before switch: $Tenant_Version"}
if $debug {log local0. "Tenant Name before switch: $Tenant_Name"}
pool P_test_vcookie
}
- Nat_Thirasuttakorn
Employee
I think you need to save original request in variable, and use HTTP::retry to accomplish this... - Jay_Sawyer_1110
Nimbostratus
@ natty76 - the pool command in HTTP_RESPONSE will not work, will your suggestion hold true for the virtual command? - Nat_Thirasuttakorn
Employee
Actually, I meant to use HTTP::retry in HTTP_RESPONSE. Then HTTP_REQUEST will be invoke again.
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