Code Monkey home page Code Monkey logo

Comments (6)

shealan avatar shealan commented on September 6, 2024 1

Here is the deployment url: https://yjdiw86zpj.execute-api.ap-southeast-2.amazonaws.com/dev

This was a new new Nuxt Create App project. The serverless file looks like this:

service:
  name: nuxt-serverless-tmp

plugins:
  - serverless-nuxt-plugin

resources:
  Resources:
    AssetsBucket:
      Type: AWS::S3::Bucket
      Properties:
        BucketName: ${self:custom.nuxt.bucketName}
        CorsConfiguration:
          CorsRules:
            - AllowedMethods:
              - GET
              - HEAD
              AllowedOrigins:
              - "*"

provider:
  name: aws
  region: ap-southeast-2
  stage: ${opt:stage, 'dev'}
  runtime: nodejs12.x
  environment:
    NODE_ENV: ${file(.env.${self:provider.stage}.yml):NODE_ENV}

custom:
  nuxt:
    version: v0.0.1-alpha
    bucketName: nuxt-serverless-tmp-${self:provider.stage}

functions:
  nuxt:
    handler: handler.render
    events:
      - schedule: rate(5 minutes)
      - http: ANY /
      - http: ANY /{proxy+}

I deployed the project again from scratch with no changes to any aws config via the console.

from serverless-nuxt.

wan2land avatar wan2land commented on September 6, 2024 1

Nuxt does not support the form of the API Gateway URL(https://***.execute-api.ap-southeast-2.amazonaws.com/dev). Removing the path(/dev) after the URL solved the problem. So, Mapping the domain solves it. I recommend the plugins serverless-domain-manager(https://github.com/amplify-education/serverless-domain-manager).

from serverless-nuxt.

shealan avatar shealan commented on September 6, 2024 1

I figured it out.

I removed the aliases from route 53. Created a cloudfront distribution that used the custom domain certificate in ACM. I then created a new A name alias to that distribution.

I'll post a tutorial on accidental.dev soon so help anyone else out who might need to do something similar.

Thanks again for your input, I wouldn't have been able to find my way to a solution without it. And thank you for creating such a great package :)

from serverless-nuxt.

wan2land avatar wan2land commented on September 6, 2024

The favicon and manifest files are not saved in s3, it is called from labmda.
If you changed the settings related to favicon or manifest in the nuxt.config.js file, show me the file.

from serverless-nuxt.

shealan avatar shealan commented on September 6, 2024

Ok great, almost there. That fixes those issues - thank you 👍

I couldn't get the plugin working so reproduced what it does manually in the console.

The only problem I have now is that the site is only accessible via https. How can I automatically redirect all http traffic to https? I saw in a previous help topic you mentioned using edge optimised?

image

I did that but I still can't access the page via http (https works). Do I need to do something in Cloudfront as well? Nothing seems to have been added automatically. The domain currently still points directly to the lambda in Route53.

image

from serverless-nuxt.

wan2land avatar wan2land commented on September 6, 2024

Thanks for reporting the issue. :-)

from serverless-nuxt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.