Forum Discussion
Allanwynn_16283
Nimbostratus
Oct 18, 2015irule for rewrite
Hi Everyone,
So we have a setup where the user access the VS of F5 "https://my.url.com".
Our current setup is using client source IP based for load balancing (odd-even):
when HTTP_REQUEST {
...
Vernon_97235
Oct 18, 2015Historic F5 Account
Yes. Rewrite the HTTP Host header as it is proxied from client-side request to server-side request:
when HTTP_REQUEST {
if { [getfield [IP::client_addr] . 4] & 0x01 == 1 } {
HTTP::host "our.url1.com"
}
else {
HTTP::host "our.url2.com"
}
}
- Allanwynn_16283Oct 18, 2015
Nimbostratus
hi? can you help me with my question? My question is, is there an irule that i can use with this irule(odd-even source ip based) that will rewrite the location url into https://my.url.com also? i.e. NOW: if user's IP is 10.10.10.20 and access https://my.url.com he will be redirected to https://our.url2.com, and he will see that url (https://our.url2.com) on his browser and if user's IP is 10.10.10.21 and access https://my.url.com he will be redirected to https://our.url1.com, and he will see that url (https://our.url1.com) on his browser WHAT WE WANT: if user's IP is 10.10.10.20 and access https://my.url.com he will be redirected to https://our.url2.com, and but he will see on his url is https://my.url.com on his browser and if user's IP is 10.10.10.21 and access https://my.url.com he will be redirected to https://our.url1.com, and but he will see on his url is https://my.url.com on his browser - Vernon_97235Oct 18, 2015Historic F5 AccountI apologize if I missed something you wanted (e.g., @stanislas's pool selection) but I do believe that this accomplishes what you request. I altered the mechanism for octet extraction and odd/even selection in order to make it more compact and slightly faster. More to the point, server virtual host selection is generally a function of the submitted HTTP Host header value. Changing that in HTTP_REQUEST will change it between the BIG-IP and the Pool Member only. Thus, the client will not "know" that a change was made at all (and as such, the originally selected URL will remain unaltered in the user-agent/browser).
- Allanwynn_16283Oct 19, 2015
Nimbostratus
Hi, thank you for your feedback. But what if we have an issue with the communication between F5 big ip and the servers, wherein creating basic load balancing setup: VS 443 and pool is port 80, so we decided just to redirect it with the server itself. Can we use this for this setup for added security? WHAT WE WANT: if user's IP is 10.10.10.20 and access https://my.url.com he will be redirected to https://our.url2.com, and but he will see on his url is https://my.url.com on his browser and if user's IP is 10.10.10.21 and access https://my.url.com he will be redirected to https://our.url1.com, and but he will see on his url is https://my.url.com on his browser
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