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 31, 2015Nimbostratus
No, this wasn't the problem. I ended with this one, and it works like a charm, thank you for the support:
when HTTP_REQUEST {
set CORS_DOMAINS_REGEX ".(domain1.com|domain2.com)$"
set HTTP_pool "mypool"
if { [HTTP::header exists Origin] } {
set origin_host [HTTP::header Origin]
if { $origin_host matches_regex $CORS_DOMAINS_REGEX } {
pool $HTTP_pool
} else {
HTTP::respond 403
}
}
else {
pool $HTTP_pool
}
}
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