Foreman not working with NGINX

孤者浪人 提交于 2019-12-07 02:36:53

问题


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.


回答1:


You'll want to run nginx in foreground mode by adding the following to your nginx.conf

daemon off;

You can specify a custom nginx.conf to nginx with the -c argument



来源:https://stackoverflow.com/questions/8734398/foreman-not-working-with-nginx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!