Forum Discussion
iRule http host with wildcard domain
- Jul 25, 2024
Thanks for all the advice. I have solved it.
when HTTP_REQUEST {
switch -regexp [HTTP::host] {
"^[a-zA-Z0-9_-]+\.domain.com" { }
default { drop }
}
}This irule works. Thanks all.
Hello, Can you follow below expample.
when HTTP_REQUEST {
if { ([HTTP::host] == "www.example.com") } {
# Do nothing, meaning permit request
} elseif { ([HTTP::host] == "web.example.com") } {
# Do nothing, meaning permit request
} elseif { ([HTTP::host] == "access.example.com") } {
# Do nothing, meaning permit request
} else {
# If the host header does not contain any of the previously matching values then reject the request
reject
}
}
Hello, sir. Thanks for reply. In fact, I have hundreds of domain names which I cannot list them all. Like www, oa, web, web2 and so on. There are too many I cannot put in a data group. I just want to allow *.example.com and disallow *.*.example.com. Using a wildcard domain. Is there a way?
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