Forum Discussion
JamesS_40157
Aug 29, 2012Nimbostratus
Try next irule (or different virtual server) if 404 response
Hi,
We are currently implementing a new virtual server to replace a legacy one, essentially it is a giant media (image) server. The legacy virtual server has a quite complicated irule in place to serve the images. I have crafted an irule for the new virtual server to take care of various bits and pieces for the new architecture, however during migration it is possible that not all media/images will be available on the new virtual server, but will definitely exist on the old. I'm therefore trying to find a way to seamlessly always serve the correct content to the user without noticing any redirects.
Essentially what I would like to do is say, if a 404 is returned from the new virtual server backend node, to instead try the legacy virtual server - this should be seamless to the client and look like a simple GET request and 200 response.
Is this possible? I have tried adding a clause in the HTTP_RESPONSE event for the new virtual server irule to say if a 404 is received then to set the virtual server to the legacy one (which has extra irules on it) but this does not work.
I have thought about placing the legacy irule below that of the new irule on the new virtual server, however I can't work out how to get (in the case of a 404 response) the current irule to "exit" and fall down to the legacy irule. I would prefer not to merge the two irules together as they are both reasonably large and complicated! I need to find a way to "trap/catch" the 404 response, and get the load balancer to re-request the URI but to the legacy virtual server. Any ideas are much appreciated!!
Thank you :)
James
- JamesS_40157NimbostratusIsn't it funny how sometimes when you post a question you immediately think of the answer? :)
- Colin and I just discussed this post on my most recent Post of the Week.
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