N
Nuxt4w ago
yashwp

Did anyone able to deploy Nuxt 3 prerender site on AWS-Amplify?

The deployment show successful, but when I visit https://main.<hash_string>.amplifyapp.com, I'm not able to access the site. Though if I add /index.html at the end I can see the deployed version. I've deleted Rewrites and redirects rule that are there. When I'm trying to visit to another routes directly too, it is throwing 502 error. How can I fix this?
3 Replies
Smef
Smef4w ago
I haven't used amplify, but you way want to check the config of the service to make sure that index.html is a 'default document' for routes. I would expect that to be configured by default, though. If you can see the generated static bundle you could also download that to make sure it's the right structure Make sure you're using nuxt generate and not nuxt build if you're trying to use SSG. A 502 error makes it sound like it's trying to forward traffic to an actual running Nuxt server
yashwp
yashwp3w ago
default document is fine and since it is SSR, nuxt build would do.
Smef
Smef3w ago
Do you need a Procfile for Amplify to specify the app and port which is running behind the reverse proxy? For Elastic Beanstalk I know you need a Procfile in your project root with content like
web: PORT=8080 node .output/server/index.mjs
web: PORT=8080 node .output/server/index.mjs
Want results from more Discord servers?
Add your server
More Posts