serverless-with-next5-boilerplate icon indicating copy to clipboard operation
serverless-with-next5-boilerplate copied to clipboard

Known issue: Serverless `staging` path rewrites messing with links

Open Vadorequest opened this issue 6 years ago • 1 comments

On AWS, I can't get Next.js to work correctly because of the Serverless staging path rewrite:

The main page (https://11lwiykejg.execute-api.us-east-1.amazonaws.com/development/) works fine, but:

  • when clicking on a "Page 2" link, it goes to the wrong URL: https://11lwiykejg.execute-api.us-east-1.amazonaws.com/page2, it's missing the /development part and the browser will display {"message":"Forbidden"}
  • Current workaround: I used a custom domain, it fixes the missing development part (by removing the staging part of the url entirely, which fixes the issue): - https://swn.dev.vadorequest.fr - https://swn.dev.vadorequest.fr/page2

Vadorequest avatar Mar 05 '18 15:03 Vadorequest

A solution that doesn't rely on Custom Domain would be interesting and useful when doing tests against AWS without providing a custom domain (which isn't trivial to do, since it requires to own a domain)

Vadorequest avatar Mar 09 '18 10:03 Vadorequest