I has been using an ALB until I realized I cannot connect a private ALB to API gateway ... so am trying NLB now.
So far I have
- Private NLB
- API Gateway VPC Link to connect to NLB
But I am unsure how to configure API gateway properly. I did:
- Created a test route
GET /test
- Use VPC Link, tried proxy and non-proxy types
- But I am unsure of what do I put for endpoint URL. For now I did something like:
http://dummydomain.com/api
wheredummydomain.com
is a dummy domain and/api
is my status check URL which should work
Its my 1st time trying NLB. Is there anything I am missing?
Currently when I test my API gateway function: I get HTTP500
{
"message": "Internal server error"
}
The logs:
Execution log for request 2d5e2e51-b04c-11e8-b9fe-97b354c20146
Tue Sep 04 14:09:45 UTC 2018 : Starting execution for request: 2d5e2e51-b04c-11e8-b9fe-97b354c20146
Tue Sep 04 14:09:45 UTC 2018 : HTTP Method: GET, Resource Path: /test
Tue Sep 04 14:09:45 UTC 2018 : Method request path: {}
Tue Sep 04 14:09:45 UTC 2018 : Method request query string: {}
Tue Sep 04 14:09:45 UTC 2018 : Method request headers: {}
Tue Sep 04 14:09:45 UTC 2018 : Method request body before transformations:
Tue Sep 04 14:09:45 UTC 2018 : Endpoint request URI: http://dummydomain.com/api
Tue Sep 04 14:09:45 UTC 2018 : Endpoint request headers: {x-amzn-apigateway-api-id=4p76zcriuk, User-Agent=AmazonAPIGateway_4p76zcriuk, Host=dummydomain.com}
Tue Sep 04 14:09:45 UTC 2018 : Endpoint request body after transformations:
Tue Sep 04 14:09:45 UTC 2018 : Sending request to http://dummydomain.com/api
Tue Sep 04 14:09:56 UTC 2018 : Execution failed due to configuration error: There was an internal error while executing your request
Tue Sep 04 14:09:56 UTC 2018 : Method completed with status: 500
Something I am curious about ... the target group has
- Protocol: TCP
- Port: 80
- Target type: IP
- Healthcheck passes
But my app is running on port 3000. But healthchecks is passing it also correctly reflects my application is running on port 3000
But wondering if the port 80 part is a problem? Does NLB translate the port 80 traffic into port 3000?