String replace in URI when certain node active
Replace component of path when failed over to a certain node.
I have a bit of a tricky situation here.
First I have A priority group (say 10) of two nodes load balancing, and when there are less than one (ie no nodes) available in that priority group I want it to fail to the third node (say priority group 5) I understand thats easy just to do in the GUI.
The tricky part is, when those first two nodes go down and I fail over to that third node, I then want to replace a component in the URL path - for example sake I need to replace hello with goodbye before I send the request to the server (but only when that third node is the one receieving traffic) for example I need to replace
https://demo.com/hello/1234?num=1 with https://demo.com/goodbye/1234?num=1
I guess I can do the URI bit with this but how do I only do it when using that third node? And is the below right anyway?
when HTTP_REQUEST { HTTP::uri [string map -nocase {"/hello/" "/goodbye/"} }