因此,我在EC2实例上托管的RESTFUL Flask API前面设置了一个AWS API网关,并使用了gunicorn,但它给了我一个非常难看的端点,有没有办法让它可以使用自定义URL?
我得到了这个网址https://123x123x.execute-api.eu-west-2.amazonaws.com/myendpoint/
我想要像https://myurl.net/myendpoint
一样
简短的回答是:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowCloudFrontUpdateDistribution",
"Effect": "Allow",
"Action": [
"cloudfront:updateDistribution"
],
"Resource": [
"*"
]
}
]
}
https://123x123x.execute-api.eu-west-2.amazonaws.com/myendpoint/
的边缘优化API端点myurl.net
域创建自定义DNS名称a1b2c3d4e5f6.cloudfront.net
AWS的更长答案详述如下:https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-custom-domains.html
注意:这也可以在很大程度上使用AWS API Gateway REST API进行管理:https://docs.aws.amazon.com/apigateway/api-reference/link-relation/domainname-create/