AWS API Gateway proxy endpoint

663 views Asked by At

I am trying to implement few already existing APIs. Suppose i have a application running on server say

192.168.0.1:8036

. It has various routes like

http://192.168.0.1:8036/api/sample/a1?name=swas&class=tty
http://192.168.0.1:8036/api/samp/a2?addr=swas&roll=tty

Have a custom domain name say

api.example.com

So here i want to direct every request through AWS Gateway. Finally request would be like

Request

http://api.example.com/api/samp/a2?addr=swas&roll=tty

would be passed as

http://192.168.0.1:8036/api/samp/a2?addr=swas&roll=tty

Note: There could be multiple Routes with different dynamic parameter

In short every request which comes to api.example.com/* should be passed through AWS gateway to 192.168.0.1:8036/*

2

There are 2 answers

1
MikeD at AWS On BEST ANSWER

This sounds like a straight forward use of http proxy with a custom domain name.

Documentation for setting up http proxy is here

Documentation for setting up custom domain names is here

From your use case description, you'll want to set-up the custom domain name with no base path so that it points to a single API. You'll also want to specify the stage in the base path mapping so that the caller doesn't have to provide it.

0
collins lidédé On

AWS API Getway has limitation for one custom domain per one REST API. Not sure exactly what the question is here, but you can map multiple base paths, which you will have to define manually. double check here