Forum Discussion
TJ01
Nov 17, 2021Nimbostratus
Restrict domain access via host IP
HI Guys, The requirement is to restrict site access via IP - I am trying to block access based on host value Can someone please review and advise if the below event block will work. ...
Nov 17, 2021
Hi TJ01,
You can use [HTTP::header host] or [HTTP::host]
when HTTP_REQUEST {
if { [HTTP::host] equals "10.11.12.13" } {
log local0. "request dropped - Host: [HTTP::host] ClientIP: [IP::client_addr]"
drop
}
}
For access only with host "abc.example.com"
when HTTP_REQUEST {
if { [HTTP::host] ne "abc.example.com" } {
log local0. "request dropped - Host: [HTTP::host] ClientIP: [IP::client_addr]"
drop
}
}
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