Forum Discussion
RKC_260787
Nimbostratus
Jul 24, 2018HTTP Referer headers
I have a requirement to check HTTP Referer headers and restrict it to base URL and anything else should be denied .
Example -- URL -- https://123test123.com
Referer Header should be only https:...
Andy_McGrath
Cumulonimbus
Jul 24, 2018when HTTP_REQUEST {
set referer [string tolower [HTTP::header value "Referer"]]
Reject if Referer is not blank and does not start with https://123test123.com/
if {($referer != "") && !($referer starts_with "https://123test123.com/")} {
log local0.info "Rejecting request to [HTTP::uri] with Referer $referer"
reject
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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