This example shows us how to control nginx with supervisor so when nginx goes down for whatever reason, supervisor will bring it up again as a "foreground" process not as a "daemon".
Important
Supervisor uses daemon off; to start Nginx. The daemon off; directive tells Nginx to stay in the foreground. The sudo service nginx stop/start/restart commands won’t work. For more information read Stack Overflow answer.
Current nginx process
As you can see below, Nginx is running in “daemon on” mode.
1 2 3 4 5
root@us:~# ps aux | grep nginx root125270.00.21325761064 ? Ss 09:520:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on; www-data 125290.21.61341768092 ? S 09:520:07 nginx: worker process www-data 125300.00.71328083800 ? S 09:520:00 nginx: cache manager process root131540.00.18900660 pts/0 S+ 10:380:00 grep --color=auto nginx