Next.js Discord

Discord Forum

🚨 Next.js App Restarting on Every Request on VPS (Apache + PM2) #1

Unanswered
American English Coonhound posted this in #help-forum
Open in Discord
American English CoonhoundOP
I'm hosting a Next.js app on a VPS using Apache, Webmin, and PM2. However, every time someone visits the website, the server restarts npm run start, causing CPU spikes.
1.Deployed Next.js app with pm2 start npm --name "nextjs-app" -- run start
2.Set up Apache reverse proxy to localhost:3000
3.When I visit the site, PM2 restarts the app.
Checked pm2 logs
What I've Tried
Restarted Apache
Ensured npm run build was executed before npm run start
Increased memory limits

0 Replies