Forum Discussion
iRule help
We need to configure iRule datagroup with a list of domains referenced by iRule that would allow web access (port 80 if it does matter) based on this list. If the host header does not match list, access should not be permitted.
My assumption is like below, please correct if anything is missing. Thanks.
when HTTP_REQUEST { if {class match [string tolower [HTTP::header "User-Agent"] contains ]} pool else none }
1 Reply
Hi,
The datagroup name is missing and you are getting the User-Agent instead of the Host header, and a couple of syntax issues. Below a valid example. You need to have a string based datagroup named "MY_DATAGROUP_NAME" :
when HTTP_REQUEST { if { [class match [string tolower [HTTP::header "Host"] equals MY_DATAGROUP_NAME] } { pool mypoolname } else { you can use drop, reject or HTTP::respond command reject }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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