Configuring API Portal behind a external Loadbalancer

webMethods API Portal guide

Many a times you would like to have a external loadbalancer which is bound to DNS, which internally routes the request to internal application loadbalancer. In this article we will how we can configure the loadbalancer component of API Portal to work with such a scenario.


For the sake of explanation, we will assume we have DNS (developers.fazio.com) which is bound to a external loadbalancer. This loadbalancer receives the request from external world and routes to the one of the configured internal application loadbalancer.  Let us assume we have the internal loadbalancer which is running in the default http port (18101). The external loadbalancer is configured to receive the traffic on the http port(80) and forward to any one of the available internal available application loadbalancer(18101).

Problem

As we seen in this article, application loadbalancer itself a (service) component which registers itself in the application registry(Zookeeper). In some scenarios, Application queries the service registry to construct the fully qualified URLs(to use the URLs in onboarding invites/ password reset mails). In a normal installations, loadbalancer register itself in service registry with its current host and port. In this case, if application LB1 is running on host mcapache1.fazio.com, then it would register itself as (Protocol: http, host:mcapache1.fazio.com, port:18101). If the application uses this information to generate the mail content, then this URL(http://mcapache1.fazio.com:18101) may not be even accessible to the endusers. Application suppose to generate URLs using external facing LB(http://developers.fazio.com/)

Solution

All we have todo is that we just have inform the internal application loadbalancer about the presence of external LB. This would help the internal LB to register itself using the details of external LB instead of its own. We just have to reconfigure the internal application loadbalancer with below 3 properties:

reconfigure loadbalancer_s

+HTTPD.zookeeper.default.scheme=http

+HTTPD.servername=developers.fazio.com

+HTTPD.redirect.http.port=":80"

Similarly for a https:

reconfigure loadbalancer_s

+HTTPD.zookeeper.default.scheme=https

+HTTPD.servername=developers.fazio.com

+HTTPD.redirect.https.port=":443"

image.jpg