Forum Discussion
FaresB
Nimbostratus
Apr 22, 2020Blocking an URI wildcard to a specific Hostname and using an header
Hi, I'm trying to block wildcard " /* "but I need to allow access to " /pathA/* " and " /pathB/* " from a specific hostname, I need also to block these paths in the "Referer" header. Ba...
cjunior
Nacreous
Apr 22, 2020Hello,
According to my understanding, could be this:
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] contains "myhostname.society.com" && !( [HTTP::uri] contains "/pathA" || [HTTP::uri] contains "/pathB" || [HTTP::header Referer] contains "/pathA" || [HTTP::header Referer] contains "/pathB" ) } {
HTTP::respond 403
}
}as well this one:
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] contains "myhostname.society.com" } {
switch -glob [HTTP::path][HTTP::header Referer] {
"*/pathA*" -
"*/pathB*" { }
default { HTTP::respond 403 }
}
}
}I hope it helps.
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
