Forum Discussion
Skylark_233940
Nimbostratus
Aug 16, 2018Can I change a redirect to a new server address on the same loadbalancer?
Is there a way for a HTTP redirect to point to the same Loadbalancer but move the connection to another poolmember/node?
My attempt may explain better what I am trying to do:
when HTTP_REQUEST {
set r_host [getfield [HTTP::host] ":" 1]
}
when HTTP_RESPONSE {
if { [HTTP::is_redirect] }{
set r_loc [HTTP::header Location]
scan $r_loc "http://%d.%d.%d.%d:%d" ip1 ip2 ip3 ip4 port
set ipaddress $ip1.$ip2.$ip3.$ip4
change to new server address (PROBLEM: traffic on way out, change has no effect)
node $ipaddress $port
replace IP with DNS of Loadbalancer (and http>https)
set r_loc [regsub -all http://$ipaddress:$port $r_loc https://$r_host]
HTTP::header replace Location $r_loc
}
}
- Pedro_HaoaRet. Employee
Hello,
Can you take a look this solution to check if it's what you are trying to look for?
VIDEO ARTICLELightboard Lessons: Vip Targeting Vip
- quantiti_170569
Nimbostratus
This will leak your internal IP address if you publish this to client
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