Forum Discussion
fahmy_28867
Nimbostratus
Sep 15, 2010irule needed depend on URL not site ip
i have virtual server https load on http pool i need to create irule to accept the header if requet only with URL of the https site and deny any the request if it requested via the website ip .Any one can help me on this .Thanks in advance
- The_Bhattman
Nimbostratus
Hi Fahmy,when HTTP_REQUEST { if hosts header does not match the whitelist then drop the request if { ![matchclass [HTTP::header "Host"] eq $::hostswhitelist] } { drop } }
- fahmy_28867
Nimbostratus
thanks Bhattman for your reply ,i'v a very short experience with irule so i need to ask about the white list data group how can i create it ,Is the white list include my URL ? say the url https://www.test.com/webaccess\ what is the change in the scripte attached?thanks for your patient .I will use your script as it is . - fahmy_28867
Nimbostratus
when HTTP_REQUEST { if { [HTTP::host] eq "https://www.test.com/webaccess\" } { drop } } }
- Chris_Miller
Altostratus
when HTTP_REQUEST { if { !([string tolower [HTTP::host]] eq "www.test.com") } { discard } }
- fahmy_28867
Nimbostratus
Hi Chris , - Chris_Miller
Altostratus
Posted By fahmy on 09/16/2010 12:50 AM - hoolio
Cirrostratus
If you just want to drop requests made by IP address, you could do a simple test for any alpha character instead of a specific white list. This would be less specific but more efficient than checking a datagroup for every request.when HTTP_REQUEST { if { not [string match {*[a-zA-Z]*} [HTTP::header host]] }{ discard } }
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