I'm stuck trying to set up multiple Node apps on different domains on the same Digital Ocean camera. I followed Host Multiple Node.js Applications on the same VPS with nginx, forever and crontab exactly.
I have all the correct pointers and a set of records.
I can not force applications to run (from forever) on any port other than the standard express 3000.
I changed the Nginx settings as he asked:
I uncommented server_names_hash_bucket_size 64; (as they say)
I created the /etc/nginx/conf.d/example.com.conf files for applications (these are different domains, I put 1 on port 3000 and the other on 4000).
Example:
server {
listen 80;
server_name your-domain.com;
location / {
proxy_pass http://localhost:{YOUR_PORT};
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
, Nginx ? "npm start"? ?
, . , Node .