HTTP API自定义域名无法使用。

0

【以下的问题经过翻译处理】 你好,

我们有一个HTTP API网关设置,VPC链接映射到ALB,该ALB为ECS Fargate任务的请求提供服务。

我为我的api设置了一个区域自定义域名,如xyz.abc.com。结果是一个目标域名,形式为: d-xxxxx.execute-api.eu-central-1.amazonaws.com

我将Route53别名从我的xyz.abc.com添加到上面的“API网关域名”。 xyz.abc.com A ALIAS d-xxxx.execute-api.eu-central-1.amazonaws.com

我添加了自定义域名在阶段“$default”上的API映射,没有配置路径。无论是https://d-xxxx.execute-api.eu-central-1.amazonaws.com还是我的自定义域名都不能导航到我的API(400 Bad request)。 但是https://[ApiId].execute-api.eu-central-1.amazonaws.com确实可以。 URL中有一个查询参数,ECS任务在尝试使用自定义域名或https://d-xxxx.execute-api.eu-central-1.amazonaws.com时无法找到该参数,这在日志中有记录。

profile picture
EXPERT
asked 6 months ago19 views
1 Answer
0

【以下的回答经过翻译处理】 对于使用HTTP API和代理路由ANY / {proxy+}的任何人,您需要显式定义路由方法,以便自定义域路由和CORS正常工作。希望文档更加明确,但希望这可以帮助遇到此问题的人们!

profile picture
EXPERT
answered 6 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions