Forum Discussion
Require host header
Would it be ok to go with 1 Irule & 1 Datagroup, but your datagroup entries has to be updated as & when you start applying this Irule to your required VS.
Logic:
Create a datagroup with records matching the VS name & its values with urls with comma separated in case multiple SAN's.
virtual_1 {
data www.google.com
}
virtual_2 {
data www.facebook.com,www.messenger.com
}
Create an irule to capture the host header & VS name.
set virtual [findstr [virtual name] "" 8 ]
Then use class match to lookup the VS & get the values of it & set to a variable, this would tell what all values are whitelisted for that virtual.
Now do a if condition & check if the host header matches to the variable, if yes allow. else drop.
In case of multiple values, use foreach cmd & do your condition check.
This Irule can be applied as generic Irule. But make sure you add the right records before applying.
Let me know what you think.
I second this suggestion. One ring iRule to rule them all and a datagroup to match VS name to (any possible) host headers. Other alternative I had in mind was to match the virtual server IP to the host header, but again - using a datagroup.
- jaikumar_f5Feb 19, 2021MVP
Well yeah, thats much simpler. Dont have to worry about URL's. Great one 😎
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