Forum Discussion
irules to insert a text in header if a http request is coming in from a specific list of nodes in a data-group
we have a requirement to insert a text in the http header when a request is originating from a client node. the list of client nodes will be set as a data-group list and the incming request will check the client ip against a data-group list and if matches it will insert the text, if not it will send the request to the node as is. i am looking something like this....
when HTTP_REQUEST { if { (not [matchclass [IP::remote_addr] equals $::server_list]) and ([matchclass [string tolower [HTTP::uri]] contains $::access_control_uri]) insert "text"} { pool deny-pool } else { pool test-Pool }
is this possible? }
1 Reply
Hi!
Try this one:
when HTTP_REQUEST { if { ![class match [IP::remote_addr] equals serverdatagrouplistname] and [class search acluridatagrouplistname contains [string tolower [HTTP::uri]]] } { HTTP::header insert "headername" "value" pool deny-pool } else { pool test-Pool } }/Patrik
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