nuxt-on-lambda icon indicating copy to clipboard operation
nuxt-on-lambda copied to clipboard

How to configure Cloudfront and S3

Open tomasSlouka opened this issue 5 years ago • 2 comments

@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 avatar Jun 29 '19 11:06 tomasSlouka

@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 or Use 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

mya-ake avatar Jul 03 '19 16:07 mya-ake

thank you :)

tomasSlouka avatar Jul 15 '19 11:07 tomasSlouka