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.
For wild card we could use an equivalent string function: I just writing a rule, you can test it. if its not worked use pool as well
when HTTP_REQUEST {
if { [string match "example*.domain.com" [string tolower [HTTP::host]]] } {
}
else {
reject
}
}
- spaceccJul 25, 2024Altostratus
Thanks for reply, sir. Please check this.
My irule is:
when HTTP_REQUEST {
if { [string match "*.hackit.com" [string tolower [HTTP::host]]] } {
log local0. "Host is [HTTP::host]"
} else {
reject
}
}Check the log:
<HTTP_REQUEST>: Host is www.gslb.hackit.com
The irule didn't work. My goal is if I access *.hackit.com, it passes. When I access *.*.hackit.com, it rejects.
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