Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

Restricting HTTP traffic to the server by checking status code 200

Hi

I want to check the HTTP response status code from server for a HTTP request. If the response status code is not 200 then I want the HTTP request not to hit a particular server (e.g. 192.168.52.52:80) using iRule.
Is it possible to implement an iRule like this using HTTP response code to restrice traffic to a particular server?

Thanks & Regards,

AJ
0
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER
sort of a chicken & egg scenario there... you can't get the server response status code without first sending it the request...
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER
You could apply a ECV monitor to the pool which requires a 200 response from the server. If you don't know what request the client is going to send, then you can't really create an ECV for it.
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER
I agree with Deb here, this is a chicken and egg scenario.

How can you know what the response code is before your request has been processed?

If you want to stop certain requests from getting to certain servers, that's doable. And if you want certain response codes not to go back to the client, also doable. You could even watch for response codes and depending on the server's response, you could stop any other requests like the one that created that response code from going back to that server (though that would be an interesting iRule and probably pretty resource intensive due to saving every request/response pair until inspected...it's possible). But there's just no way to know what the response code is going to be until the request is processed.

#Colin
0