Forum Discussion
I don't think I need to use the HTTP::retry if the HTTP::respond or HTTP::redirect is sending the request to a completely new LTM. And HTTP::retry is not a valid event in HTTP_REQUEST anyways.
My main concern is using the HTTP::respond or HTTP::redirect and trying to send it via IP and carry and try to carry the URL info to the other DC LTM. The same URL's exist on both LTM's and we can't mess with adjusting domain names or changing SSL certificates to include SAN's, etc.
Do you think this would work ok?
HTTP::redirect https://2.2.2.2[getfield [$host] ":" 1][$httpuri]
Since I am trying to put the actual VIP IP address in the HTTP::redirect, would there be a way to strip it out once it reaches the other DC LTM? And also not have the client see it? Any examples? Thank you! Thank you!
Option 2
Apply iRule on DC1 LTM VIP's
when CLIENT_ACCEPTED {
set default_pool [LB::server pool]
}
when HTTP_REQUEST {
Check if response is a redirect from the DC2 LTM based on the status code, (301, 302, 303, 305, or 307) and also if it contains it's own header, "DC1-ID"; then send the request to the default pool on DC1 LTM
if { ([HTTP::is_redirect]) && { ([HTTP::header] contains "DC1-ID"}) } {
pool $default_pool
Exit iRule
return
}
Save the host header value
set host [HTTP::host]
Save the URI
set httpuri [string tolower [HTTP::uri]]
}
when HTTP_RESPONSE {
Check incoming packets from DC1 application database for "DC2-ID" header
if { [HTTP::header] contains "DC2-ID"} {
If "DC2-ID" header exists, redirect to DC2 LTM VIP IP address. 2.2.2.2 represent the DC2 LTM VIP.
HTTP::respond 302 Location https://2.2.2.2$htturi
HTTP::redirect https://2.2.2.2[getfield [$host] ":" 1][$httpuri]
log local0. "DC2-ID header found and request was redirected to DC2 VIP - requested Host: [HTTP::header host] --- URI: $httpuri"
return
}
}