我一直在使用 ALB,直到我意识到我无法将私有 ALB 连接到 API 网关......所以现在正在尝试 NLB。
到目前为止我有
- 私人 NLB
- API Gateway VPC Link 连接到 NLB
但我不确定如何正确配置 API 网关。我做了:
- 创建了一条测试路线
GET /test
- 使用 VPC Link,尝试过代理和非代理类型
- 但我不确定我为端点 URL 放了什么。现在我做了类似的事情:虚拟域
http://dummydomain.com/api
在哪里,我的状态检查 URL 应该可以工作dummydomain.com
/api
这是我第一次尝试 NLB。有什么我想念的吗?
目前,当我测试我的 API 网关功能时:我得到 HTTP500
{
"message": "Internal server error"
}
日志:
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
我很好奇的事情......目标群体有
- 协议:TCP
- 端口:80
- 目标类型:IP
- 健康检查通过
但是我的应用程序在端口 3000 上运行。但是运行状况检查通过它也正确反映了我的应用程序在端口 3000 上运行
但是想知道端口 80 部分是否有问题?NLB 是否将端口 80 流量转换为端口 3000?