Forum Discussion
Vova_1985_18320
May 28, 2015Nimbostratus
iRule based on domain
Hi im looking for a way to accept traffic with * expression, is it possible?
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] eq "*.example.com*"} {
pool $HTTP_pool
} el...
Vova_1985_18320
May 28, 2015Nimbostratus
This example of how i think it should be, not sure this is the right way to do it:
when HTTP_REQUEST {
if { [HTTP::header exists Origin] } {
set origin_host [HTTP::header Origin]
}
}
when HTTP_RESPONSE {
if { [info exists origin_host] } {
if { $origin_host contains "mydomain1.com, mydomain2.com, mydomain3.com" } {
pool $HTTP_pool
} else {
HTTP::respond 403
}
}
}
- PeteWhiteMay 28, 2015Employeerather than having multiple entries in your statement you need to use a datagroup and the class match command. Take a look at https://clouddocs.f5.com/api/irules/class.html and specifically the examples, it's pretty simple to use and very extensible.
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