-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
I suggest to change the hardcoded node version to dynamic path by loading nvm.
https://www.cloudpanel.io/docs/v2/nodejs/deployment/pm2/
Here is how to run pm2 resurrect using crontab without hardcoding the node version:
In crontab -e just add:
SHELL=/bin/bash
@reboot source ~/.nvm/nvm.sh && pm2 resurrect > /dev/null
Another thing I would like to mention is that the node.js deployments by default don't try to use NGINX to serve static content.
This is a better approach to take off the overhead of static content from node.js event loop.
Example:
location / {
try_files $uri @backend;
}
location @backend {
proxy_pass http://127.0.0.1:{{app_port}};
...
}
The last trailing slash on proxy_pass is important to remove. And Root Directory is updated accordingly to the public directory (static content folder)
Metadata
Metadata
Assignees
Labels
No labels