Foreman does not work with NGINX

I'm trying to use Foreman (version 0.31.0) to control our application processes, but I'm not very lucky with nginx (nginx / 1.0.10 + Phusion Passenger 3.0.11).

Here is the corresponding line from my Procfile:

nginx: sudo /home/ubuntu/nginx/sbin/nginx 

When I launch the application, Forman reports that nginx starts and then terminates immediately:

 $ 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 actually works, although Foreman reports it differently.


Similarly, if I export to Upstart:

 rvmsudo foreman export upstart /etc/init -a my_app -u ubuntu 

and run sudo start my_app , nginx will start correctly. But sudo stop my_app does not stop nginx. He continues to work.

Is there a trick for working with nginx with Foreman?

Note: I found this problem with Foreman , and I am wondering if this is related.

+6
source share
1 answer

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

 daemon off; 

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

+9
source

Source: https://habr.com/ru/post/905143/


All Articles