Relative Content

Tag Archive for next.jslambdaapi-gateway

{“message”:”Forbidden”} when navigate to another page for nextjs 14 app deployed to aws lambda integarted with api gateway

My frontend uses nextjs 14 with a Docker file, github actions build and push the docker image to aws ECR, cloudformation retrieve the docker image from ECR and create lambda function and its integrated api gateway. With the url from stage of api gateway, I can access the page, but when navigate to another page from e.g homepage, I got {“message”:”Forbidden”} shown in the browser instead of the real page. And the same for other page i.e if I access the page via the url provided by api gateway stage, I can access the page, but if e.g I navigate to homepage, I got {“message”:”Forbidden”} again.