Foreman 不使用 NGINX
我正在尝试使用 Foreman (版本 0.31.0)来管理我们应用程序的进程,但我对 nginx 的运气不太好(nginx/1.0.10 + Phusion 乘客 3.0.11)。
以下是我的 Procfile 中的相关行:
nginx: sudo /home/ubuntu/nginx/sbin/nginx
当我启动应用程序时,Foreman 报告 nginx 已启动,然后立即终止:
$ foreman start
21:18:28 nginx.1 | started with pid 27347
21:18:28 nginx.1 | process terminated
21:18:28 system | sending SIGTERM to all processes
然而,nginx 实际上正在运行,尽管 Foreman 另有报告。
同样,如果我导出到 Upstart:
rvmsudo foreman export upstart /etc/init -a my_app -u ubuntu
并运行 sudo start my_app,nginx 会正常启动。但是 sudo stop my_app 不会停止 nginx。它继续运行。
让 nginx 与 Foreman 一起工作有什么技巧吗?
注意:我发现Foreman 存在这个问题,我想知道它是否相关。
I'm trying to use Foreman (version 0.31.0) to manage our application's processes but I'm not having much luck with nginx (nginx/1.0.10 + Phusion Passenger 3.0.11).
Here's the relevant line from my Procfile:
nginx: sudo /home/ubuntu/nginx/sbin/nginx
When I start the app, Foreman reports that nginx is started and then immediately terminated:
$ foreman start
21:18:28 nginx.1 | started with pid 27347
21:18:28 nginx.1 | process terminated
21:18:28 system | sending SIGTERM to all processes
However, nginx is actually running, even though Foreman reports otherwise.
Similarly, if I export to Upstart:
rvmsudo foreman export upstart /etc/init -a my_app -u ubuntu
and run sudo start my_app
, nginx starts properly. But sudo stop my_app
does not stop nginx. It continues running.
Is there a trick to getting nginx to work with Foreman?
Note: I found this issue with Foreman and I'm wondering if it's related.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要通过将以下内容添加到 nginx.conf 来在前台模式下运行 nginx
您可以使用 -c 参数为 nginx 指定自定义 nginx.conf
You'll want to run nginx in foreground mode by adding the following to your nginx.conf
You can specify a custom nginx.conf to nginx with the -c argument