Forum Discussion
AJ_6093
Nimbostratus
Jan 15, 2009Restricting 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
3 Replies
- Deb_Allen_18Historic F5 Accountsort of a chicken & egg scenario there... you can't get the server response status code without first sending it the request...
- wolfpack_98881
Nimbostratus
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_12Historic F5 AccountI 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
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects
