【问题标题】:Hosting multiple angular apps using 1 S3 bucket and 1 CloudFront使用 1 个 S3 存储桶和 1 个 CloudFront 托管多个 Angular 应用程序
【发布时间】:2021-10-07 14:29:43
【问题描述】:

我计划在 1 个 AWS S3 存储桶和 1 个 AWS CloudFront 中托管多个 Angular 应用程序?像这样。

AWS S3 存储桶

  • /app1
  • /app2

网址

  • example.com/app1
  • example.com/app2

在 AWS CloudFront 中,是否需要指定“默认根对象”?对于错误页面处理,我们如何设置,如果是来自 app1 的错误代码 403,则以 /app1/error.html 响应,如果来自 app2,则以 /app2/error.html 响应?

【问题讨论】:

  • 为什么要它们在 1 个 S3 和 1 个 CF 内?
  • 用于维护和节省成本。

标签: angular amazon-web-services amazon-s3 amazon-cloudfront


【解决方案1】:

您可以使用 CloudFront 函数来根据需要更改请求链接。 这是一个文档链接 https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/example-function-add-index.html

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-10-12
    • 2020-07-24
    • 1970-01-01
    • 1970-01-01
    • 2021-12-02
    • 2022-01-08
    • 2015-07-23
    相关资源
    最近更新 更多