Another solution is to customize it like the stylesheet below. This mimics the idea of a web server where the routing path is dependent on the plugin. The plugin contains the path, and the actual URL. The stylesheet works by searching for the path on the plugin, then extract the routing url and sslproxy if ssl is needed from that path element.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform"
xmlns:fo="
http://www.w3.org/1999/XSL/Format" xmlns:xs="
http://www.w3.org/2001/XMLSchema"
xmlns:fn="
http://www.w3.org/2005/xpath-functions"
xmlns:xdt="
http://www.w3.org/2005/xpath-datatypes"
xmlns:dp="
http://www.datapower.com/extensions"
xmlns:dpconfig="
http://www.datapower.com/param/config" extension-element-prefixes="dp"
exclude-result-prefixes="dp dpconfig">
<!-- Author: Huy Huynh
zachahuy@gmail.com -->
<!-- The purpose of this stylesheet is to do dynamic routing -->
<xsl:template match="/">
<!-- load routes document -->
<xsl:variable name="RouterMap" select="document('local:///Router-443Map.xml')"/>
<xsl:variable name="uri" select="dp:variable('var://service/URI')"/>
<xsl:message dp:priority="debug"><xsl:value-of select="$uri"/></xsl:message>
<xsl:variable name="route">
<xsl:copy-of select="$RouterMap/routes/route[@uri=$uri]/routingURL" />
</xsl:variable>
<!--<xsl:message dp:priority="debug"><xsl:value-of select="$route"/></xsl:message>-->
<xsl:variable name="sslid">
<xsl:copy-of select="$RouterMap/routes/route[@uri=$uri]/sslProxyProfile"/>
</xsl:variable>
<!-- copy input to the output since this is last action in the rule -->
<xsl:copy-of select="."/>
<!-- set backend routing variable -->
<xsl:if test="string-length($sslid) > 0">
<dp:set-variable name="'var://service/routing-url-sslprofile'" value="$sslid"/>
</xsl:if>
<dp:set-variable name="'var://service/routing-url'" value="$route"/>
</xsl:template>
</xsl:stylesheet>
-----------------------------------------
plug in xml which can be externalize for the cluster to share
<?xml version="1.0" encoding="utf-8"?>
<routes>
<!-- xwww33aetnacom.xml Router map for External-80 MPGW use to route external traffic coming through port 80 -->
<route uri="/v1/services/WestAddressSearch">
<routingURL>
http://somehostname:3000/services/WestAddressSearch</routingURL>
<sslProxyProfile/>
</route>
<route uri="/v1/services/EastAddressSearch">
<routingURL>
http://canalsobehostalias:3001/services/EastAddressSearch</routingURL>
<sslProxyProfile/>
</route>
<route uri="/helloworld">
<routingURL>
http://canalsobeloadbalancerobject:16651/helloworld</routingURL>
<sslProxyProfile>SomeSSLProxyForHTTPS</sslProxyProfile
</route>
<route uri="/healthcheck">
<routingURL>
https://127.0.0.1:90/healthcheck.xml</routingURL>
<sslProxyProfile>SomeSSLProxyForHTTPS</sslProxyProfile
</route>
</routes>