Forum Discussion
pacoyelo_309383
Nimbostratus
Feb 08, 2017Redirection based on pool member
Fist of all apologize for my lack of knowledge. I need to redirect to different URL based on pool member balanced (it's not possible to do it on server side).
For example:
Pool_Member_1 --- red...
Feb 08, 2017
If you really did mean redirect, and not rewrite, this might do the trick (not tested):
when LB_SELECTED {
if { [IP::addr [LB::server addr] equals 192.168.1.1] } {
HTTP::respond 302 Location "https://www.hostname1.com/extension"
} else {
HTTP::respond 302 Location "https://www.hostname2.com/extension"
}
}
Seems like a funny thing to do, but who am I to judge without knowing the background. 🙂
Change to 301 from 302 if you want to make the redirect permanent.
/Patrik
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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