-1

I am trying to see if it's possible to route user requests to serverA or serverB based on their IP address or Host Name.

Currently users are accessing an application via URL, https://thisismyprodserver:9999 let's call this serverA and now the business want to set up a serverB and deploy the new code here. They then want to filter some of the users to use serverB for testing but without them knowing any difference as they are still access their application using the same URL. The don't want the user to see any difference on the front end. Once a small number of users have tested the updated application on serverB they will then route all remaining users over to serverB which will now become production.

I was hoping the Datapower could step in and route the request to either serverA or serverB based on the incoming users IP address.

The current flow is USER Request <->WebServer <->AppServer I was wondering if the Datapower could step in and change the flow to USER Request ->WebServer -> IDG -> ServerA -> ServerB

Application is running in WAS v9 and the Webserver is Apache 2.4

I am also looking to see if this can be done via the WebServer but would like to integrate the IDG into the application.

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
SMcGill
  • 1
  • 2

1 Answers1

0

Your question is a bit unclear but the best option is of course to do this in a load-balancer using a pool with rules to direct different IP's to different endpoints.

If you have the TLS/SSL certificate on the instance they "hit" you can't "forward" the connection in anyway so in that case your only option is to either use the second instance as a "back-end" service and the first as "proxy" or to use a url-open to grab data from the second and return to the first. You can also return a 301 redirect but there are a lot of services/software that doesn't like that in an API/Service implementation. Neither of these two options does what you strive for though as there is no clear path into the final migration to the second box as you seek.

A better approach for it is to add a "proxy service", e.g. a MPGW, which routes to the service either on 127.0.0.1:xxxx or to the other box depending on the request source IP. That way you can have identical services on both boxes and the request always hits the same "proxy" service. This is also know as "chained services" in DataPower lingo...

Anders
  • 3,198
  • 1
  • 20
  • 43
  • Thanks for your response Anders. So the idea is that there will be two versions of the same application. The current application and a future application. So at one point all users will be using the current environment and then for future we will migrate a few users to "test" the application and once they are happy we will start cutting over the rest of the users from current to future. Yes the application uses SSL. I'm looking at using routing-url on the DP as outlined here https://www.ibm.com/support/knowledgecenter/SS9H2Y_7.5.0/com.ibm.dp.doc/var-service-routing-url_reference.html. – SMcGill Jun 16 '20 at 22:56