Question
How to deploy NextJS with NGINX?
So I know how to deploy a React app on a server.
- npm run build
- create a server block and point the root to my react app folder build (root /var/www/xfolder/build;)
- systemctl restart nginx
- run my node server (nohup node server &&) and its done.
I feel kind of dumb for not understanding this with NextJS. I run npm run build
I'm expecting something like a build folder. I've tried setting the server block root to /var/www/xfolder/.next but the page still gives 403 forbidden. And do I need to run npm run start? I'm confuse on how to properly deploy the app. I'm using Ubuntu, NginX (1gb droplet) in DigitalOcean.