Forum Discussion

AJ_6093's avatar
AJ_6093
Icon for Nimbostratus rankNimbostratus
Jan 15, 2009

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
  • Deb_Allen_18's avatar
    Deb_Allen_18
    Historic F5 Account
    sort of a chicken & egg scenario there... you can't get the server response status code without first sending it the request...
  • 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.
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    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