gpt4 book ai didi

amazon-web-services - 同一域上的 CloudFront 和 API Gateway 服务

转载 作者:行者123 更新时间:2023-12-04 02:01:29 24 4
gpt4 key购买 nike

我想要:

  • 在我的域 www.example.com 上分发网站的静态部分(html、css、js)。
  • 将 API Gateway 服务放在我的域中的文件夹 www.example.com/v1 下。

  • 我该如何实现?

    在53路,据我了解只能指向 cloudfront 分发,所以我选择我的 S3/CloudFront 启用存储桶。

    因此,最终结果应该是,按照优先级/映射的顺序:
  • www.example.com/v1/* <-> API 网关 <-> Lambda <-> DynamoDB
  • www.example.com/* <-> CloudFront <-> S3 存储桶内容

  • 我可以通过什么方式实现这一目标?如果没有,我的替代方案是什么,因为我需要在 Web 浏览器中遵循同源原则要求。

    最佳答案

    您将使用两个源(S3 和 API 网关)设置 CloudFront,并将 CloudFront 配置为对以 /v1 开头的所有请求使用 API 网关源。

    关于amazon-web-services - 同一域上的 CloudFront 和 API Gateway 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42818724/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com