2

I have installed WSO2 API Manager on an EC2 server. It is working just fine but I would like to make is available through nice url (using port 443 and not 9443).

So, instead of:

https://example.com:9443/store (API Manager)

https://example.com:8243 (API Gateway)

It would look like:

https://developer.example.com/store (API Manager)

https://api.example.com (API Gateway)

How do you achieve this on AWS?

My plan was to place two load balancers in front of the ec2 server. The first load balancer would port forward from incoming port 443 to outgoing port 9443 on the wso2 ec2 server (API Manager). The second load balancer would port forward incoming port 443 to outgoing port 8243 on the wso2 ec2 server (API Gateway).

When I try this I get no response within the browser, it just times out. I have also tried this on the non-ssl ports and it still doesn't work.

Any ideas? What am I missing? How can you port forward in AWS? What is the best approach?

Abimaran Kugathasan
  • 31,165
  • 11
  • 75
  • 105
Jumpman
  • 43
  • 2
  • I think a reverse proxy will solve my problem. No load balancer needed with port forwarding. I am going to try it out. http://madamadasune.com/2015/08/apache-reverse-proxy-configuration-for-wso2-api-manager/ – Jumpman Oct 11 '16 at 19:06
  • Works great. I just setup an Apache reverse proxy on the same server as the API Manager. – Jumpman Oct 26 '16 at 22:01

1 Answers1

0

Above is easily achievable using AWS ALB and 2 target groups. You need to configure one target group with port 9443 (TG1) and other one with 8243(TG2). Configure TCP/HTTPS target group health check for both TGs and attach same node to both target groups.

You need to add 2 ALB rules to route your requests based on host header of the request. There you can configure one rule as check domain name "developer.example.com" and forward to TG1. Second rule is check the domain name "api.example.com" and forward requests to TG2.

If you are using 2 WSO2 APIM nodes, please make sure to enable stickiness in TG1 (9443).

You need only 1 HTTPS listner in the AWS ALB with 443 port.