我有API网关自定义域api.example.com
,它指向CDN d12345678.cloudfront.net
。
基本路径映射设置为:
Path = /apitest
Destination = apiName : teststage
我可以使用CDN域和自定义域使用CURL调用API,如下所示:
curl -i https://d12345678.cloudfront.net/apitest/methodpath \
-H "Host: api.example.com" -X POST -d '{param:123}' \
-H "Content-Type: application/json" \
-H "Authorization:xxxxxxxxx AUTHORIZATION TOKEN HERExxxxxxx"
并获得成功的回应。但是我只能使用自定义域进行呼叫,例如:
curl -i https://api.example.com/apitest/methodpath \
-H "Host: api.example.com" -X POST -d '{param:123}' \
-H "Content-Type: application/json" \
-H "Authorization:xxxxxxxxx AUTHORIZATION TOKEN HERExxxxxxx"
当我尝试此操作时,它总是返回:
403(ForbiddenException)