Forum Discussion
cg1603
Nimbostratus
Jul 09, 2025irule to block a non valid url
Hi, we send web traffic to our F5 APM, this traffic is analyzed by an Elasticsearch server Sometimes our APM receives an invalid http request that causes problems on our Elasticsearch server. The ...
Injeyan_Kostas
Nacreous
Jul 09, 2025Hello cg1603
From your example seems that host header is malformed also
So my first approach would be to accept only valid host header as a starting point with an irule like this
when HTTP_REQUEST
{
switch -- [string tolower [HTTP::host]]
{
"www.example.com"
{
# Valid Host — allow request
return
}
default
{
log local0. "Blocked invalid Host: $host from [IP::client_addr]"
HTTP::respond 403 content "Forbidden - Invalid Host"
}
}
}
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