0

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/*

3
  • 1
    And your question is... how to do this? What are you running at api.example.com? Nginx? Apache? HAProxy? ELB? ALB? CloudFront? Commented Dec 27, 2016 at 13:12
  • @Michael-sqlbot yes, how to do this? I am running Nginx Commented Dec 28, 2016 at 4:20
  • We need to clarify this question, further, because I originally read it... backwards. I thought you wanted Nginx → API Gateway but now I think you want API Gateway → Nginx. API Gateway can't access private address space using the HTTP Service Proxy mode. Your Nginx server must be accessible from the Internet for API Gateway to access it, if this is what you want. But you can secure your Internet-accessible endpoint by configuring API Gateway to authenticate itself. Commented Dec 28, 2016 at 11:11

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, this is what i wanted.
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.