Report this

What is the reason for this report?

Next.JS Deployment to Nginx Droplet

Posted on September 10, 2020

I’m currently attempting to deploy my Next.js SSG application to the same droplet that my backend graphql api is hosted on. The api sits at /graphql while the app sits at /app but when I navigate to /app I get a loading… page with console showing the server is "404"ing the page.

I’m not getting any errors on the Next.js side of npm run build and npm start or with pm2 in actually starting the website. It’s clearly pulling from the next.js app as some of the resources its failing to grab are _app.js which is the root file for my next.js app.

I thought it might be an environmental variable thing but I have the same next.config.js file as my local version on the server and my local version works in both dev and production mode.

Any help on this would be greatly appreciated.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.