Mike_Graston_10
Mar 13, 2007Nimbostratus
401 response with message and logging
I have a scenerio where I am not sure on how to do this. I would like to filter a uri that contains the string /abc. Any ip address that hits it I would like to log and send back a 401 Unauthorized page to the user and a message that their IP address has been logged as "client IP". Also i would need to know where the log messages go, as you might have figured I haven't worked with logging at all. I don't want to log every IP just the ones that hit this rule, and I don't know if I need to add an elseif statement to continue sending others who don't meet this criteria to the pool or web servers?
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] contains "/abc"} {
HTTP::respond 401
}
}