Forum Discussion
Multiple server with one VS
- Nov 20, 2022
Abdou76 ,
sure you can do this ,
try this :when HTTP_REQUEST { if {[HTTP::host] eq "abc.com"}{ pool pool_1 } elseif {[HTTP::host] eq "xyz.com"}{ pool pool_2 } elseif {[HTTP::host] eq "ghl.com"}{ pool pool_3 } }
Hope it works with you.
Regards - Nov 20, 2022
Hi mohamedT
hank you for your great help
Hi Abdou76 ,
Yes , it is doable on F5 by two methods LTM Policies or iRule :
First :
> create two pools , and Put " 10.10.10.10 in pool_1" and "10.10.10.11 in Pool_2".
> then , Go to ( Local traffic , Policies ) and follow the below Article , steps to construct you LTM policy :
https://techdocs.f5.com/kb/en-us/products/big-ip_ltm/manuals/product/local-traffic-policies-getting-started-12-1-0/1.html
its quite Long but it is helpful 😀
- you need to perform such below snap shots :
Create two rules in LTM policy :
Do not Forget to Publish your Policy to be able to assign it in virtual servers , find below :
> assign your LTM policy to your virtual server " 172.16.250.100"
> you can do this Task By iRule :
when HTTP_REQUEST {
if { [HTTP::host] eq "abc.com" }
{ pool_1} elseif
{ [HTTP::host] eq "xyz.com" }
{ pool_2}
}
> I recommend LTM policy as it is simpe and light on F5 appliance.
I hope this helps you.
Regards
- CA_ValliNov 11, 2022MVP
Correct answer, just be careful with iRule syntax because putting parenthesis on new lines like that can result in issues - expecially on the elseif statement. Also, pool command is pool <pool_name>
when HTTP_REQUEST { if {[HTTP::host] eq "abc.com"}{ pool pool_1 } elseif {[HTTP::host] eq "xyz.com"}{ pool pool_2 } }
I would suggest using LTM policies too, since it uses a configuration template that is better supported during software upgrades, and also typically performs 20% faster.- Nov 11, 2022
Hi CA_Valli ,
I am grateful for your advise ,
I do add this in my Notes , when implementing iRules.
Thanks alot
Recent Discussions
Related Content
* 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