我知道在这里有很多类似的问题被发布和回答,但没有一个与我所经历的完全相同。
我有一个处理传入请求(GET和POST)的Lambda函数。我还设置了一个作为公共终端点的API网关。此外,我设置了自定义域名,遵循设置API主机名的自定义域名
测试调用在Lambda和API网关控制台中都可以工作。使用调用URL也可以正常工作,但是使用我设置的自定义域名无法工作。
以下是一些更多详细信息:
调用URL(可用):
https://{api gateway id}.execute-api.us-west-2.amazonaws.com/prod/endpoint
自定义域名终点(无效):
https://api.{my domain}.com/endpoint
基本路径映射:
/endpoint endpoint:prod
所有方法授权:
Authorization None
API Key Not required
Route53:
A record as alias that points api.{my domain}.com to the cloudfront distribution domain name as alias target.
我真的很感激如果有人知道这里发生了什么。
BasePath Mapping
更改为:/ endpoint:prod
。或者尝试使用现有的BasePath Mapping
来访问https://api.{my domain}.com
。 - MaiKaY