How to setup CloudFront default root object?

0

I am export a NextJS static web and host it by CloudFormation distribution. However, I always need to type cloudformation-domain.net/index.html. I want to access **without index.html **

https://www.cloudformation-domain-net/ 

When I host the NextJS with Amplify, it also use CloudFront and working without the "index.html"

3回答
1
承認された回答

In the CloudFront distribution settings there is a default root object option.

General Tab > Settings section > Edit > scroll down to Default root object and enter index.html here.

profile pictureAWS
回答済み 2年前
  • Thank you! I go it done

1

Hello Everyone.

And for cases where the origin is an ALB? How to set a default root object where there is no object to set?

I'm trying to solve te AWS SecurityHub "CloudFront distributions should have a default root object configured" item. But my origin is an ALB, routing my URLs without a default root object.

Best Regards, Ransés Marques

回答済み 1年前
0

The default root object is typically used when serving static content from an S3 bucket or other simple origin types. When using an ALB as your origin, you rely on the ALB's ability to route requests to different resources based on the request path, query parameters, or other conditions. Therefore, CloudFront doesn't control the default root object for ALB origins.

回答済み 7ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ