nuxt-on-lambda
nuxt-on-lambda copied to clipboard
How to configure Cloudfront and S3
@mya-ake mya-ake .. do you have any recommendations on how to set up CF and S3 so the deployed nuxtjs app will have access to the static files on S3 as well as use the custom domain?
@tomasSlouka Sorry for the late reply.
I extracted only important parts. In the case of this repository.
CloudFront
Origins
- API Gateway
- Nuxt.js Server
- Origin Type:
Custom Origin
- Origin Domain Name:
API Gateway endpoint
- Origin Path:
/dev
- S3
- Static Resources
- Origin Type:
S3 Origin
- Origin Domain Name:
Select your S3 bucket
- Restrict Bucket Access:
Yes
- Origin Access Identity:
Create a New Identity
orUse an Existing Identity
- Grant Read Permissions on Bucket:
Yes, Update Bucket Policy
- The setting of S3 is completed by selecting this
Behaviors
- API Gateway Origin
-
Default (*)
-
- S3 Origin
-
_nuxt/*
-
static_pages/*
-
assets/*
-
Error Pages
- 403
- HTTP Error Code:
403: Forbidden
- Customize Error Response:
Yes
- Response Page Path:
/_static_pages/403/index.html
- HTTP Response Code:
403: Forbidden
- HTTP Error Code:
thank you :)