Controller File Updated On Nginx But Server Still Serves Old Content

- 1 answer

I recently made some changes to one of my controllers on my nodejs application, the changes work fine locally, but when I deploy to the production server, though the changes reflect in the code on the server, it still serves the old version of the file. Am I missing out something?

I've tried restarting the server using

sudo systemctl restart nginx

Result stays the same. Also tried redeploying, even tried to break the code and push it like that, yet all I get is the same old version. Any solution?

P.S I use PM2 in starting the app



I finally fixed it! Turns out I had to restart pm2 and not nginx. So I just ran

pm2 reload APP_NAME

And it updates

P.S You can know what APP_NAME is by running pm2 list