Skip to main content

Support multi-host with multi-aws-api via Datawiza

About 1 min

The section talks about how to support multi-host with multi-aws-api in Datawiza Cloud Management Console (DCMC). The network architecture is like this: architecture The request to https://api1.datawiza.com needs to be proxy passed to AWS API https://api1.execute-api.region.amazonaws.com. The request to https://api2.datawiza.com needs to be proxy passed to AWS API https://api2.execute-api.region.amazonaws.com.

Prerequisite

Both of the domains https://api1.datawiza.com and https://api1.datawiza.com should be resolved to the EC2. The Stages of AWS API1 is test while the Stage of AWS API2 is dev: aws api1 stagesaws api2 stages

Configure in DCMC

First step is to follow the document here to configure the deployment for the first API. Once that’s done, let’s config the second API as below: dcmc-api1 It is used to proxy pass request to https://api1.datawiza.com to https://api1.execute-api.region.amazonaws.com. Now, we will add another application in this deployment which is called api2. It is used to proxy pass request to https://api2.datawiza.com to https://api2.execute-api.region.amazonaws.com: Click Create Application and input the needed info, click Create: add app api2 Click Edit of api2.
Click Advanced tab, open the SSL button and upload the cert and private key. For testing purposes, you can use self-signed cert: dcmc ssl configdcmc ssl config In the same tab, input the host of upstream as the Proxy Header Host. Please contact your administrator to check if SNIopen in new window is enabled in your upstream environment. You can enable the Upstream SNI option if your API needs it. Failing to configure this correctly may result 502 Bad Gateway. Click Save: dcmc proxy header host

That's all, let's check about the result. For API1, visit https://api1.datawiza.com/test:api1 test For API2, visit https://api2.datawiza.com/dev: api2 dev