我使用nginx并拥有一个node.js应用程序,该应用程序将永远启动。
如果我手动将CD放入应用程序文件夹并使用forever start index.js
启动该应用程序,则它可以正常工作。
但是如果我使用forever start /var/www/myapp/index.js
启动应用程序,它将无法正常工作。在这两种情况下,都会永远启动应用程序。
为什么Nginx在这里有问题?我的nginx conf看起来像这样:
server {
listen 443 ssl;
server_name www.example.com;
ssl_certificate /var/wwwssl/example.pem;
ssl_certificate_key /var/wwwssl/example.key.pem;
location / {
proxy_pass https://www.example.com:8443;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}