bmohanak_276891
Oct 24, 2016Cirrus
Solved
Help with an iRule to allow based on two URIs
Dear Friends,
I need help with an iRule to allow access to a Pool based on two URIs and send a 403 Access Denied otherwise
So Initially I had this for one URI's but the application owner wanted two URIs I need help adding the Second URI to the iRule to allow access to the Pool otherwise send an Denied Message
URI's /JSSResource/abc/xyz/123 /healthcheck.html
The statement below sets the variable name of uri and the value string to lower case
set uri [HTTP::uri]
The statement below calls the variable uri and matches on conditions starts with and not equal to
if { $uri starts_with "/JSSResource/" and $uri ne "/JSSResource/"}{ pool p-casper-stage log local0. p-casper-stage } else { HTTP::respond 403 content [format "Access Denied"] } }
Thanks for the Help!
Yep, "Starts_with" worked. Many Thanks to ekaleido and Odaah!!!